Download react-hook-form/cypress/e2e/setError.cy.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/setError.cy.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/cypress/e2e/setError.cy.ts
-
curl -L -o setError.cy.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/setError.cy.ts
1.1 kB
| describe('form setError', () => { | |
| it('should contain 3 errors when page land', () => { | |
| cy.visit('http://localhost:3000/setError'); | |
| cy.get('#error0').contains('0 wrong'); | |
| cy.get('#error1').contains('1 wrong'); | |
| cy.get('#error2').contains('2 wrong'); | |
| cy.get('#error3').contains('3 test'); | |
| cy.get('#error4').contains('4 required'); | |
| cy.get('#error5').contains('5 minLength'); | |
| cy.get('#error').contains( | |
| 'testMessageThis is required.Minlength is 10This is requiredThis is minLength', | |
| ); | |
| }); | |
| it('should clear individual error', () => { | |
| cy.visit('http://localhost:3000/setError'); | |
| cy.get('#clear1').click(); | |
| cy.get('#clear2').click(); | |
| cy.get('#error0').contains('0 wrong'); | |
| }); | |
| it('should clear an array of errors', () => { | |
| cy.visit('http://localhost:3000/setError'); | |
| cy.get('#clearArray').click(); | |
| cy.get('#error0').contains('0 wrong'); | |
| }); | |
| it('should clear every errors', () => { | |
| cy.visit('http://localhost:3000/setError'); | |
| cy.get('#clear').click(); | |
| cy.get('#errorContainer').should('not.value'); | |
| }); | |
| }); | |