Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
300bbe25ea |
@@ -115,7 +115,7 @@ function decodedLine(label) {
|
|||||||
// `tokenBalances` there, for the site's transaction sending TRANSFER_DATA to
|
// `tokenBalances` there, for the site's transaction sending TRANSFER_DATA to
|
||||||
// the token, on Sepolia unless `chainId` names another chain. Confirm answers
|
// the token, on Sepolia unless `chainId` names another chain. Confirm answers
|
||||||
// the signed transaction with a failure, which leads to the error screen.
|
// the signed transaction with a failure, which leads to the error screen.
|
||||||
async function showSepoliaTransfer(
|
async function showTokenTransfer(
|
||||||
tokenBalances = [],
|
tokenBalances = [],
|
||||||
chainId = NETWORKS.sepolia.chainId,
|
chainId = NETWORKS.sepolia.chainId,
|
||||||
) {
|
) {
|
||||||
@@ -191,7 +191,7 @@ describe("a token tracked on Sepolia only", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("is named on the Contract line and the decoded Token line, with its amount at its scale", async () => {
|
test("is named on the Contract line and the decoded Token line, with its amount at its scale", async () => {
|
||||||
await showSepoliaTransfer();
|
await showTokenTransfer();
|
||||||
expect(node("approve-tx-to").innerHTML).toContain(
|
expect(node("approve-tx-to").innerHTML).toContain(
|
||||||
'<div class="font-bold mb-1">TDOL</div>',
|
'<div class="font-bold mb-1">TDOL</div>',
|
||||||
);
|
);
|
||||||
@@ -204,7 +204,7 @@ describe("a token tracked on Sepolia only", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("labels the amount on the error screen that follows", async () => {
|
test("labels the amount on the error screen that follows", async () => {
|
||||||
await showSepoliaTransfer();
|
await showTokenTransfer();
|
||||||
await confirm();
|
await confirm();
|
||||||
expect(state.currentView).toBe("error-tx");
|
expect(state.currentView).toBe("error-tx");
|
||||||
expect(node("error-tx-summary").textContent).toBe("1234.5000 TDOL");
|
expect(node("error-tx-summary").textContent).toBe("1234.5000 TDOL");
|
||||||
@@ -215,7 +215,7 @@ describe("a token tracked on Sepolia only", () => {
|
|||||||
// tracks and holds there names nothing on Sepolia.
|
// tracks and holds there names nothing on Sepolia.
|
||||||
test("a token tracked and held on mainnet only is not named, and its amount is in base units", async () => {
|
test("a token tracked and held on mainnet only is not named, and its amount is in base units", async () => {
|
||||||
state.trackedTokens = [{ address: TOKEN, symbol: "MDOL", decimals: 18 }];
|
state.trackedTokens = [{ address: TOKEN, symbol: "MDOL", decimals: 18 }];
|
||||||
await showSepoliaTransfer([
|
await showTokenTransfer([
|
||||||
{ address: TOKEN, symbol: "MDOL", decimals: 18, balance: "1.0" },
|
{ address: TOKEN, symbol: "MDOL", decimals: 18, balance: "1.0" },
|
||||||
]);
|
]);
|
||||||
expect(node("approve-tx-to").innerHTML).not.toContain("MDOL");
|
expect(node("approve-tx-to").innerHTML).not.toContain("MDOL");
|
||||||
@@ -229,7 +229,7 @@ test("a token tracked and held on mainnet only is not named, and its amount is i
|
|||||||
|
|
||||||
// The From and Contract lines, and the decoded Token and Recipient lines.
|
// The From and Contract lines, and the decoded Token and Recipient lines.
|
||||||
test("every address links to the Sepolia explorer", async () => {
|
test("every address links to the Sepolia explorer", async () => {
|
||||||
await showSepoliaTransfer();
|
await showTokenTransfer();
|
||||||
const sepolia = NETWORKS.sepolia.explorerUrl;
|
const sepolia = NETWORKS.sepolia.explorerUrl;
|
||||||
expect(node("approve-tx-from").innerHTML).toContain(
|
expect(node("approve-tx-from").innerHTML).toContain(
|
||||||
`href="${sepolia}/address/${FROM}"`,
|
`href="${sepolia}/address/${FROM}"`,
|
||||||
@@ -254,7 +254,7 @@ test("every address links to the Sepolia explorer", async () => {
|
|||||||
|
|
||||||
// Chain id 1337 names no network here, so it has no explorer to link to.
|
// Chain id 1337 names no network here, so it has no explorer to link to.
|
||||||
test("a transaction on a chain id that names no network is shown with no address links", async () => {
|
test("a transaction on a chain id that names no network is shown with no address links", async () => {
|
||||||
await showSepoliaTransfer([], "0x539");
|
await showTokenTransfer([], "0x539");
|
||||||
expect(state.currentView).toBe("approve-tx");
|
expect(state.currentView).toBe("approve-tx");
|
||||||
expect(node("approve-tx-network").textContent).toBe(
|
expect(node("approve-tx-network").textContent).toBe(
|
||||||
"Unknown network (chain id 1337)",
|
"Unknown network (chain id 1337)",
|
||||||
|
|||||||
Reference in new issue
Block a user