-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matt Mangan
committed
Dec 5, 2023
1 parent
69327f6
commit f402382
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/component/views/create-dataset/CreateDataset.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { CreateDataset } from '../../../../src/views/create-dataset/CreateDataset' | ||
|
||
describe('Form component', () => { | ||
it('should render all form fields', () => { | ||
cy.customMount(<CreateDataset />) | ||
cy.get('[data-cy=datasetFormInputTitle]').should('be.visible') | ||
cy.get('[data-cy=datasetFormSubmit]').should('be.visible') | ||
cy.get('[data-cy=datasetFormCancel]').should('be.visible') | ||
}) | ||
|
||
it('should submit the form with correct values', () => { | ||
cy.customMount(<CreateDataset />) | ||
|
||
cy.get('[data-cy=datasetFormInputTitle]').type('Test Dataset Title') | ||
|
||
cy.get('[data-cy=datasetFormSubmit]').click() | ||
|
||
// Wait for the form submission to complete (adjust the timeout as needed) | ||
cy.wait(4000) | ||
|
||
// Assert that the form was successfully submitted | ||
cy.contains('Form Submitted!') | ||
}) | ||
}) |