Add @testing-library/cypress

This commit is contained in:
SleepWalker
2020-05-21 21:37:35 +03:00
parent e1f15b5d22
commit 97d2841eda
18 changed files with 188 additions and 137 deletions

View File

@@ -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: {