Download react-hook-form/cypress/e2e/delayError.cy.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/delayError.cy.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/cypress/e2e/delayError.cy.ts
-
curl -L -o delayError.cy.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/delayError.cy.ts
1.28 kB
| describe('delayError', () => { | |
| it('should delay from errors appear', () => { | |
| cy.visit('http://localhost:3000/delayError'); | |
| const firstInput = () => cy.get('input[name="first"]'); | |
| const firstInputError = () => cy.get('input[name="first"] + p'); | |
| const lastInput = () => cy.get('input[name="last"]'); | |
| const lastInputError = () => cy.get('input[name="last"] + p'); | |
| firstInput().type('123'); | |
| cy.wait(100); | |
| firstInputError().contains('First too long.'); | |
| lastInput().type('123567'); | |
| cy.wait(100); | |
| lastInputError().contains('Last too long.'); | |
| lastInput().blur(); | |
| cy.get('button').click(); | |
| firstInput().type('123'); | |
| lastInput().type('123567'); | |
| firstInputError().contains('First too long.'); | |
| lastInputError().contains('Last too long.'); | |
| firstInput().clear().type('1'); | |
| lastInput().clear().type('12'); | |
| lastInput().blur(); | |
| cy.get('p').should('have.length', 0); | |
| cy.get('button').click(); | |
| firstInput().type('aa'); | |
| lastInput().type('a'); | |
| firstInputError().contains('First too long.'); | |
| lastInputError().contains('Last too long.'); | |
| firstInput().clear().type('1'); | |
| lastInput().clear().type('12'); | |
| lastInput().blur(); | |
| cy.get('p').should('have.length', 0); | |
| }); | |
| }); | |