Skip to content

Commit 0c893e8

Browse files
committed
fix: update dRep directory delegation format
1 parent 0f26352 commit 0c893e8

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

tests/govtool-frontend/playwright/lib/helpers/adaFormat.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ export const correctDelegatedVoteAdaFormat = (ada: number | undefined) => {
2929
}
3030
return "0";
3131
};
32+
33+
export const correctDRepDirectoryFormat = (ada: number | undefined) => {
34+
if (ada) {
35+
return Number(ada.toFixed(0))?.toLocaleString("en-US");
36+
}
37+
return "0";
38+
};

tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import {
1111
} from "@constants/staticWallets";
1212
import { createTempDRepAuth } from "@datafactory/createAuth";
1313
import { test } from "@fixtures/walletExtension";
14-
import { correctDelegatedVoteAdaFormat } from "@helpers/adaFormat";
14+
import {
15+
correctDelegatedVoteAdaFormat,
16+
correctDRepDirectoryFormat,
17+
} from "@helpers/adaFormat";
1518
import { setAllureEpic } from "@helpers/allure";
1619
import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano";
1720
import { createNewPageWithWallet } from "@helpers/page";
@@ -265,7 +268,7 @@ test.describe("Abstain delegation", () => {
265268

266269
await expect(
267270
page.getByText(
268-
`You have delegated ₳${correctDelegatedVoteAdaFormat(balance)}`
271+
`You have delegated ₳${correctDRepDirectoryFormat(balance)}`
269272
)
270273
).toBeVisible({
271274
timeout: 60_000,
@@ -296,7 +299,7 @@ test.describe("No confidence delegation", () => {
296299
const balance = await kuberService.getBalance(adaHolder04Wallet.address);
297300
await expect(
298301
page.getByText(
299-
`You have delegated ₳${correctDelegatedVoteAdaFormat(balance)}`
302+
`You have delegated ₳${correctDRepDirectoryFormat(balance)}`
300303
)
301304
).toBeVisible({
302305
timeout: 60_000,
@@ -325,7 +328,7 @@ test.describe("Delegated ADA visibility", () => {
325328
);
326329
await expect(
327330
page.getByText(
328-
`You have delegated ₳ ${correctDelegatedVoteAdaFormat(adaHolderVotingPower)}`
331+
`You have delegated ₳ ${correctDRepDirectoryFormat(adaHolderVotingPower)}`
329332
)
330333
).toBeVisible({ timeout: 60_000 });
331334

0 commit comments

Comments
 (0)