Skip to content

Commit

Permalink
fix chimoney test; OTP part got removed - so we can connect now
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Jan 30, 2025
1 parent f0fc54f commit ab89315
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/e2e/connectAutoKeyChimoney.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { test, expect } from './fixtures/base';
import { withResolvers, getJWKS } from '@/shared/helpers';
import { fillPopup } from './pages/popup';
import { disconnectWallet, fillPopup } from './pages/popup';
import {
URLS,
login,
revokeKey,
waitForGrantConsentPage,
} from './helpers/chimoney';
import { waitForWelcomePage } from './helpers/common';
import { getStorage } from './fixtures/helpers';

test('Connect to Chimoney wallet with automatic key addition when not logged-in to wallet', async ({
Expand Down Expand Up @@ -137,24 +138,23 @@ test('Connect to Chimoney wallet with automatic key addition when not logged-in
await expect(
page.getByRole('button', { name: 'Decline', exact: true }),
).toBeVisible();
});

await test.step('connects', async () => {
await page.getByRole('button', { name: 'Accept', exact: true }).click();
expect(page.getByRole('button', { name: 'Get OTP Code' })).toBeVisible();
await waitForWelcomePage(page);
await expect(background).toHaveStorage({ connected: true });
});

// The connect process won't be able to progress further here in tests. It'll
// ask for OTP over email, which we can't access. So, we'll assume if that OTP
// page is shown, we can connect.

await test.step('revoke key', async () => {
await test.step('cleanup: revoke key', async () => {
const res = await revokeKey(page, keyId);
expect(res).toEqual({ status: 'success', data: 'success' });

const { keys } = await getJWKS(walletAddressUrl);
expect(keys.find((key) => key.kid === keyId)).toBeUndefined();
});

// await test.step('disconnect wallet', async () => {
// await disconnectWallet(popup);
// });
await test.step('cleanup: disconnect wallet', async () => {
await disconnectWallet(popup);
});
});

0 comments on commit ab89315

Please sign in to comment.