Skip to content

Commit

Permalink
Fixed hook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
razvantomegea committed Jun 20, 2024
1 parent c1fbcea commit 5a50192
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/__mocks__/data/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const WALLET_TARGET_ORIGIN = 'http://localhost';
export const WALLET_SOURCE_ORIGIN = 'https://localhost:3002';
export const MAIN_REFERRER = 'https://localhost:3001/';
export const DEFAULT_PAGE_LOAD_DELAY_MS = 2500;
export const DEFAULT_DELAY_MS = 250;
export const DEFAULT_PAGE_LOAD_DELAY_MS = 1000;
export const DEFAULT_DELAY_MS = 100;
export const DEFAULT_PASSWORD = 'P@ssw0rd123';
8 changes: 5 additions & 3 deletions src/hooks/useSignTxSchema/useSignTxSchema.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { signTxSchema, useGetNetworkConfig } from 'lib';

export function useSignTxSchema() {
const { chainID } = useGetNetworkConfig();
const isMainnet = chainID === '1';
const {
network: { chainId }
} = useGetNetworkConfig();
const isMainnet = chainId === '1';

return signTxSchema({
isMainnet,
chainId: chainID,
chainId,
hookWhitelist: [],
isSignHook: true
});
Expand Down
4 changes: 1 addition & 3 deletions src/pages/Hook/SignHook/tests/CancelPing.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ describe('Cancel ping tests', () => {
}
);

await loginWithKeystore();

await jestPuppeteer.debug();
await loginWithKeystore({ skipLoggedInCheck: true });
await page.waitForSelector(getByDataTestId(DataTestIdsEnum.dappModal));
expect(page.url()).toMatch(`${WALLET_SOURCE_ORIGIN}/sign`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Sign hook with guardian of sender test', () => {
}
);

await loginWithKeystore();
await loginWithKeystore({ skipLoggedInCheck: true });
await page.waitForSelector(getByDataTestId(DataTestIdsEnum.dappModal));
expect(page.url()).toMatch(`${WALLET_SOURCE_ORIGIN}/sign`);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Hook/SignHook/tests/SignPing.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Sign ping tests', () => {
}
);

await loginWithKeystore();
await loginWithKeystore({ skipLoggedInCheck: true });
await page.waitForSelector(getByDataTestId(DataTestIdsEnum.dappModal));
expect(page.url()).toMatch(`${WALLET_SOURCE_ORIGIN}/sign`);

Expand Down

0 comments on commit 5a50192

Please sign in to comment.