Download react-hook-form/cypress/e2e/isValid.cy.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 2.26 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/isValid.cy.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/cypress/e2e/isValid.cy.ts
-
curl -L -o isValid.cy.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/isValid.cy.ts
2.26 kB
| describe('isValid', () => { | |
| it('should showing valid correctly with build in validation', () => { | |
| cy.visit('http://localhost:3000/isValid/build-in/defaultValue'); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('input[name="firstName"]').type('test'); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('input[name="lastName"]').type('test'); | |
| cy.get('#isValid').contains('true'); | |
| cy.get('#renderCount').contains('3'); | |
| cy.get('#toggle').click(); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('#toggle').click(); | |
| cy.get('#isValid').contains('true'); | |
| }); | |
| it('should showing valid correctly with build in validation and default values supplied', () => { | |
| cy.visit('http://localhost:3000/isValid/build-in/defaultValues'); | |
| cy.get('#isValid').contains('true'); | |
| cy.get('input[name="firstName"]').clear(); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('#renderCount').contains('4'); | |
| cy.get('#toggle').click(); | |
| cy.get('#isValid').contains('false'); | |
| }); | |
| it('should showing valid correctly with schema validation', () => { | |
| cy.visit('http://localhost:3000/isValid/schema/defaultValue'); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('input[name="firstName"]').type('test'); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('input[name="lastName"]').type('test'); | |
| cy.get('#isValid').contains('true'); | |
| cy.get('#toggle').click(); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('#toggle').click(); | |
| cy.get('input[name="firstName"]').type('test'); | |
| cy.get('#isValid').contains('true'); | |
| cy.get('#renderCount').contains('7'); | |
| }); | |
| it('should showing valid correctly with schema validation and default value supplied', () => { | |
| cy.visit('http://localhost:3000/isValid/schema/defaultValues'); | |
| cy.get('#isValid').contains('true'); | |
| cy.get('input[name="firstName"]').clear(); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('#renderCount').contains('4'); | |
| cy.get('input[name="firstName"]').type('test'); | |
| cy.get('#isValid').contains('true'); | |
| cy.get('#toggle').click(); | |
| cy.get('#isValid').contains('false'); | |
| cy.get('#toggle').click(); | |
| cy.get('input[name="firstName"]').type('t'); | |
| cy.get('#isValid').contains('true'); | |
| }); | |
| }); | |