mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Add @testing-library/cypress
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import '@testing-library/cypress/add-commands';
|
||||
|
||||
import { account1, account2 } from '../fixtures/accounts';
|
||||
|
||||
// ***********************************************
|
||||
@@ -83,20 +85,6 @@ Cypress.Commands.add(
|
||||
},
|
||||
);
|
||||
|
||||
Cypress.Commands.add(
|
||||
'getByTestId',
|
||||
{ prevSubject: 'optional' },
|
||||
(subject, id, options) => {
|
||||
const selector = `[data-testid=${id}]`;
|
||||
|
||||
if (subject) {
|
||||
return cy.wrap(subject.find(selector));
|
||||
}
|
||||
|
||||
return cy.get(selector, options);
|
||||
},
|
||||
);
|
||||
|
||||
function createState(accounts) {
|
||||
return {
|
||||
accounts: {
|
||||
|
Reference in New Issue
Block a user