From ddbf88f97a05451cb4e9fe792dc126604b8320e5 Mon Sep 17 00:00:00 2001 From: Chloe <44501120+chloezxyy@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:16:01 +0800 Subject: [PATCH] fix: update token price to USD instead of USD --- cypress/e2e/pages/dex/dex.spec.ts | 22 +++++++++----------- src/pages/dex/_components/PoolPairsCards.tsx | 2 +- src/pages/dex/_components/PoolPairsTable.tsx | 2 +- src/utils/commons/TokenRename.ts | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/pages/dex/dex.spec.ts b/cypress/e2e/pages/dex/dex.spec.ts index dc551689f..c27d58753 100644 --- a/cypress/e2e/pages/dex/dex.spec.ts +++ b/cypress/e2e/pages/dex/dex.spec.ts @@ -18,9 +18,7 @@ context("/dex on macbook-16", () => { cy.wrap(ele).findByText("Pair").should("be.visible"); cy.wrap(ele).findByText("Total Liquidity").should("be.visible"); cy.wrap(ele).findByText("Volume (24H)").should("be.visible"); - cy.wrap(ele) - .findByText("Primary Token Price (USDT)") - .should("be.visible"); + cy.wrap(ele).findByText("Primary Token Price (USD)").should("be.visible"); cy.wrap(ele).findByText("APR").should("be.visible"); }); }); @@ -73,7 +71,7 @@ context("/dex on macbook-16", () => { .findByTestId("OverflowTable.SortButton") .should("exist"); cy.wrap(ele) - .findByText("Primary Token Price (USDT)") + .findByText("Primary Token Price (USD)") .findByTestId("OverflowTable.SortButton") .should("exist"); }); @@ -92,7 +90,7 @@ context("/dex on macbook-16", () => { .eq(3) .then(($ele) => { totalLiquid.push( - Number.parseInt($ele.text().substring(1).replaceAll(",", "")) + Number.parseInt($ele.text().substring(1).replaceAll(",", "")), ); }); }); @@ -118,7 +116,7 @@ context("/dex on macbook-16", () => { .eq(2) .then(($ele) => { volume.push( - Number.parseInt($ele.text().substring(1).replaceAll(",", "")) + Number.parseInt($ele.text().substring(1).replaceAll(",", "")), ); }); }); @@ -154,7 +152,7 @@ context("/dex on macbook-16", () => { }); cy.findByTestId("OverflowTable.Header").within(() => { - cy.findByText("Primary Token Price (USDT)") + cy.findByText("Primary Token Price (USD)") .findByTestId("OverflowTable.SortButton") .click(); }); @@ -165,7 +163,7 @@ context("/dex on macbook-16", () => { .eq(1) .then(($ele) => { price.push( - Number.parseInt($ele.text().substring(1).replaceAll(",", "")) + Number.parseInt($ele.text().substring(1).replaceAll(",", "")), ); }); }); @@ -210,7 +208,7 @@ context("/dex on iphone-x", () => { .should("be.visible") .should("have.text", "Total Liquidity"); cy.findByTestId("CardList.Row.Child").should("be.visible"); - } + }, ); cy.findByTestId("PoolPairsCard.CardList.24hVolume").within(() => { cy.findByTestId("CardList.Row.Title") @@ -221,7 +219,7 @@ context("/dex on iphone-x", () => { cy.findByTestId("PoolPairsCard.CardList.TokenPrice").within(() => { cy.findByTestId("CardList.Row.Title") .should("be.visible") - .should("have.text", "Primary Token Price (USDT)"); + .should("have.text", "Primary Token Price (USD)"); cy.findByTestId("CardList.Row.Child").should("be.visible"); }); cy.findByTestId("PoolPairsCard.CardList.APR").within(() => { @@ -231,7 +229,7 @@ context("/dex on iphone-x", () => { cy.findByTestId("CardList.Row.Child").should("be.visible"); }); }); - } + }, ); }); @@ -314,7 +312,7 @@ context("/dex on iphone-x", () => { if (text !== undefined) { totalLiquid.push(Number.parseInt(text.replaceAll(",", ""))); } - } + }, ); }); }); diff --git a/src/pages/dex/_components/PoolPairsCards.tsx b/src/pages/dex/_components/PoolPairsCards.tsx index a76b27e48..dcc8f371e 100644 --- a/src/pages/dex/_components/PoolPairsCards.tsx +++ b/src/pages/dex/_components/PoolPairsCards.tsx @@ -156,7 +156,7 @@ export function PoolPairsCard({ diff --git a/src/pages/dex/_components/PoolPairsTable.tsx b/src/pages/dex/_components/PoolPairsTable.tsx index 56cb0b5b5..c0d4a12b0 100644 --- a/src/pages/dex/_components/PoolPairsTable.tsx +++ b/src/pages/dex/_components/PoolPairsTable.tsx @@ -48,7 +48,7 @@ export function PoolPairsTable({ - + changeSort(SortKeys.PRIMARY_TOKEN_PRICE)} diff --git a/src/utils/commons/TokenRename.ts b/src/utils/commons/TokenRename.ts index 4d5d0c2e4..4c3297f5a 100644 --- a/src/utils/commons/TokenRename.ts +++ b/src/utils/commons/TokenRename.ts @@ -1,3 +1,3 @@ export function tokenSymbolRename(symbol: string): string { - return symbol.includes("dUSDT") ? symbol.replace("dUSDT", "csUSDT") : symbol; + return symbol.includes("dUSDT") ? symbol.replace("dUSDT", "ex_USDT") : symbol; }