Skip to content

Commit

Permalink
revert: event detectin
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Nov 12, 2024
1 parent bce08d9 commit 2072767
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions packages/app/playwright/crx/crx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,21 +481,14 @@ test.describe('FuelWallet Extension', () => {
.toBeTruthy();
});

await test.step('window.fuel.isConnected on disconnection', async () => {
const getConnectionStatus = () =>
blankPage.evaluate(() => {
return window.fuel.isConnected();
await test.step('window.fuel.on("connection") disconnection', async () => {
const onDeleteConnection = blankPage.evaluate(() => {
return new Promise((resolve) => {
window.fuel.on(window.fuel.events.connection, (isConnected) => {
resolve(isConnected);
});
});

// await blankPage.pause();
const onDeleteConnection = expect
.poll(
async () => {
return getConnectionStatus();
},
{ timeout: 15000 }
)
.toBeFalsy();
});

// Disconnect accounts from inside the `Connected Apps` page
await getByAriaLabel(popupPage, 'Menu').click();
Expand All @@ -504,7 +497,8 @@ test.describe('FuelWallet Extension', () => {
await getByAriaLabel(popupPage, 'Delete').click();
await getButtonByText(popupPage, 'Confirm').click();

await onDeleteConnection;
const isConnectedResult = await onDeleteConnection;
expect(isConnectedResult).toBeFalsy();

await getByAriaLabel(popupPage, 'Menu').click();
(await hasText(popupPage, 'Wallet')).click();
Expand Down

0 comments on commit 2072767

Please sign in to comment.