Skip to content

Commit

Permalink
test: add bad domain test
Browse files Browse the repository at this point in the history
  • Loading branch information
pnarayanaswamy committed Jul 16, 2024
1 parent 42a02ad commit 9199ebe
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions test/e2e/tests/confirmations/signatures/siwe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ describe('Confirmation Signature - SIWE', function (this: Suite) {
ganacheServer: Ganache;
mockedEndpoint: Mockttp;
}) => {
const addresses = await ganacheServer.getAccounts();
const publicAddress = addresses?.[0] as string;

await unlockWallet(driver);
await openDapp(driver);
await driver.clickElement('#siwe');
Expand Down Expand Up @@ -112,6 +109,37 @@ describe('Confirmation Signature - SIWE', function (this: Suite) {
},
);
});

it('displays alert for domain binding', async function () {
await withRedesignConfirmationFixtures(
this.test?.fullTitle(),
async ({
driver,
mockedEndpoint: mockedEndpoints,
}: {
driver: Driver;
mockedEndpoint: Mockttp;
}) => {
await unlockWallet(driver);
await openDapp(driver);
await driver.clickElement('#siweBadDomain');
await switchToNotificationWindow(driver);

const alert = await driver.findElement('[data-testid="inline-alert"]');
assert.equal(
await alert.getText(),
'Alert'
)
await driver.clickElement('[data-testid="inline-alert"]');

await driver.clickElement(
'[data-testid="confirm-footer-cancel-button"]',
);

await driver.waitUntilXWindowHandles(2);
},
);
});
});

async function assertInfoValues(driver: Driver) {
Expand Down

0 comments on commit 9199ebe

Please sign in to comment.