Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

chore: add delay to toast #208

Merged
merged 5 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/app/playwright/e2e/Bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ test.describe('Bridge', () => {
await page.locator(':nth-match(:text("Done"), 1)').waitFor();

// Check toast success feedback of tx created
// Toast message has delay of 2 seconds
await page.waitForTimeout(2000);
await hasText(page, INITIATE_DEPOSIT);
await page.locator(':nth-match(:text("Done"), 3)').waitFor();

Expand Down Expand Up @@ -215,6 +217,8 @@ test.describe('Bridge', () => {
await page.locator(':nth-match(:text("Done"), 1)').waitFor();

// Check toast success feedback of tx created
// Toast message has delay of 2 seconds
await page.waitForTimeout(2000);
await hasText(page, INITIATE_WITHDRAW);

// check time left feedback
Expand Down Expand Up @@ -388,6 +392,8 @@ test.describe('Bridge', () => {
await page.locator(':nth-match(:text("Done"), 1)').waitFor();

// Check toast success feedback of tx created
// Toast message has delay of 2 seconds
await page.waitForTimeout(2000);
await hasText(page, INITIATE_DEPOSIT);
await page.locator(':nth-match(:text("Done"), 2)').waitFor();
});
Expand Down Expand Up @@ -498,6 +504,8 @@ test.describe('Bridge', () => {
await page.locator(':nth-match(:text("Done"), 1)').waitFor();

// Check toast success feedback of tx created
// Toast message has delay of 2 seconds
await page.waitForTimeout(2000);
await hasText(page, INITIATE_WITHDRAW);

// check time left feedback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,12 @@ export const txEthToFuelMachine = createMachine(
}),
notifyEthTxSuccess: (ctx) => {
if (ctx.ethTxId && EthTxCache.getTxIsCreated(ctx.ethTxId)) {
toast.success(
'Deposit successfully initiated. You may now close the popup.',
{ duration: 5000 }
);
setTimeout(() => {
toast.success(
'Deposit successfully initiated. You may now close the popup.',
{ duration: 5000 }
);
}, 2000);
EthTxCache.removeTxCreated(ctx.ethTxId);
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,12 @@ export const txFuelToEthMachine = createMachine(
},
notifyFuelTxSuccess: (ctx) => {
if (ctx.fuelTxId && FuelTxCache.getTxIsCreated(ctx.fuelTxId)) {
toast.success(
'Withdraw successfully initiated. You may now close the popup.',
{ duration: 5000 }
);
setTimeout(() => {
toast.success(
'Withdraw successfully initiated. You may now close the popup.',
{ duration: 5000 }
);
}, 2000);
FuelTxCache.removeTxCreated(ctx.fuelTxId);
}
},
Expand Down
Loading