Skip to content

Instantly share code, notes, and snippets.

@sebpalluel
Created May 11, 2023 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebpalluel/a22a375ec9b28308d4fc15b0920a967a to your computer and use it in GitHub Desktop.
Save sebpalluel/a22a375ec9b28308d4fc15b0920a967a to your computer and use it in GitHub Desktop.
import { users } from '@test-utils/gql';
import { mock, resetMocks } from '@depay/web3-mock-evm';
describe('Authentication tests', () => {
// beforeEach(() => {
// // cy.task('db:delete-users');
// // cy.task('db:seed-db', '../../tools/test/seeds/users.sql');
// cy.on('window:before:load', (win) => {
// mock({
// blockchain: 'ethereum',
// accounts: {
// return: [users.alpha_admin.address],
// },
// });
// win.ethereum = cy.window().specWindow.window.ethereum;
// });
// });
it('cypress direct login allow logged user to see his infos', function () {
cy.login('alpha_admin');
cy.on('window:before:load', (win) => {
mock({
blockchain: 'ethereum',
accounts: {
return: [users.alpha_admin.address],
},
});
win.ethereum = cy.window().specWindow.window.ethereum;
});
cy.visit('/user');
cy.findByText(users.alpha_admin.address.slice(0, 3), {
exact: false,
}).should('be.visible');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment