Skip to content

Commit

Permalink
Merge pull request #1885 from IntersectMBO/fix/1866-copy-governance-a…
Browse files Browse the repository at this point in the history
…ction-id-shows-and-copied-incorrect-id

fix(#1866): fix formatting governance action id
  • Loading branch information
MSzalowski authored Aug 30, 2024
2 parents 42631f8 + 556d6fc commit 2af5579
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ changes.
- Fix displaying non relevant data in protocol parameter change Governance Action [Issue 1601](https://github.com/IntersectMBO/govtool/issues/1601)
- Fix voting on info actions in bootstrapping phase [Issue 1876](https://github.com/IntersectMBO/govtool/issues/1876)
- Fix missing DRep name whitespace validation [Issue 1873](https://github.com/IntersectMBO/govtool/issues/1873)
- Fix displaying wrongly formatted Governance Action ID [Issue 1866](https://github.com/IntersectMBO/govtool/issues/1866k)

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getProposalTypeLabel,
filterUpdatableProtocolParams,
filterOutNullParams,
getFullGovActionId,
} from "@utils";
import { MetadataValidationStatus, ProposalData } from "@models";
import { GovernanceActionType } from "@/types/governanceAction";
Expand Down Expand Up @@ -125,10 +126,10 @@ export const GovernanceActionDetailsCardData = ({
};

const label = getProposalTypeLabel(type);
const govActionId = `${index}${txHash}`;
const govActionId = getFullGovActionId(txHash, index);
const prevGovActionId =
prevGovActionIndex && prevGovActionTxHash
? `${prevGovActionIndex}${prevGovActionTxHash}`
? getFullGovActionId(prevGovActionTxHash, prevGovActionIndex)
: null;

const tabs = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { GovernanceActionDetailsCard } from "@organisms";
import { expect, jest } from "@storybook/jest";
import type { Meta, StoryObj } from "@storybook/react";
import { screen, userEvent, waitFor, within } from "@storybook/testing-library";
import { formatDisplayDate, getProposalTypeNoEmptySpaces } from "@/utils";
import {
formatDisplayDate,
getFullGovActionId,
getProposalTypeNoEmptySpaces,
} from "@/utils";
import { GovernanceActionType } from "@/types/governanceAction";

const meta = {
Expand Down Expand Up @@ -50,7 +54,10 @@ const commonArgs = {
} satisfies ProposalData,
};

const govActionId = commonArgs.proposal.index + commonArgs.proposal.txHash;
const govActionId = getFullGovActionId(
commonArgs.proposal.txHash,
commonArgs.proposal.index,
);

async function assertTooltip(tooltip: HTMLElement, expectedText: RegExp) {
await userEvent.hover(tooltip);
Expand Down

0 comments on commit 2af5579

Please sign in to comment.