Download react-hook-form/cypress/e2e/setFocus.cy.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/setFocus.cy.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/cypress/e2e/setFocus.cy.ts
-
curl -L -o setFocus.cy.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/cypress/e2e/setFocus.cy.ts
1.02 kB
| describe('form setFocus', () => { | |
| it('should focus input', () => { | |
| cy.visit('http://localhost:3000/setFocus'); | |
| cy.get('button:contains("Focus Input")').click(); | |
| cy.get('input[name="focusInput"]').should('be.focused'); | |
| }); | |
| it('should select input content', () => { | |
| cy.visit('http://localhost:3000/setFocus'); | |
| cy.get('button:contains("Select Input Content")').click(); | |
| cy.get('input[name="selectInputContent"]') | |
| .type('New Value') | |
| .should('have.value', 'New Value'); | |
| }); | |
| it('should focus textarea', () => { | |
| cy.visit('http://localhost:3000/setFocus'); | |
| cy.get('button:contains("Focus Textarea")').click(); | |
| cy.get('textarea[name="focusTextarea"]').should('be.focused'); | |
| }); | |
| it('should select input content', () => { | |
| cy.visit('http://localhost:3000/setFocus'); | |
| cy.get('button:contains("Select Textarea Content")').click(); | |
| cy.get('textarea[name="selectTextareaContent"]') | |
| .type('New Value') | |
| .should('have.value', 'New Value'); | |
| }); | |
| }); | |