Created
May 11, 2023 16:54
-
-
Save sebpalluel/a22a375ec9b28308d4fc15b0920a967a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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