File size: 1,459 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
describe('useFieldArray', () => {
it('should behaviour correctly without defaultValues', () => {
cy.visit('http://localhost:3000/useFieldArray/normal');
cy.get('#appendAsync').click();
cy.focused().should('have.attr', 'id', 'field0');
cy.get('ul > li').eq(0).get('input').should('have.value', 'appendAsync');
cy.focused().should('have.attr', 'id', 'field0');
cy.get('#prependAsync').click();
cy.get('ul > li').eq(0).get('input').should('have.value', 'prependAsync');
cy.get('#insertAsync').click();
cy.focused().should('have.attr', 'id', 'field1');
cy.get('#field1').should('have.value', 'insertAsync');
cy.get('#swapAsync').click();
cy.get('#field0').should('have.value', 'insertAsync');
cy.get('#field1').should('have.value', 'prependAsync');
cy.get('#moveAsync').click();
cy.get('#field1').should('have.value', 'insertAsync');
cy.get('#field0').should('have.value', 'prependAsync');
cy.get('#updateAsync').click();
cy.get('#field0').should('have.value', 'updateAsync');
cy.get('#replaceAsync').click();
cy.get('#field0').should('have.value', '12. lorem');
cy.get('#field1').should('have.value', '12. ipsum');
cy.get('#field2').should('have.value', '12. dolor');
cy.get('#field3').should('have.value', '12. sit amet');
cy.get('#removeAsync').click();
cy.get('#resetAsync').click();
cy.get('ul > li').should('not.exist');
});
});
|