-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Map and Label Happy Path Tests #3690
Conversation
Removed vultr server and associated DNS entries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few very small nit comments to take a look through here.
PR is great through - clean and easy to ready, love it 👍
On the handleSubmit()
- it's worth explicitly testing that this has not been called when validation errors are shown. I'd suggest that rather than adding this to a random test or each test, just add a new test for just this instance - a little more atomic and explicit.
editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.test.tsx
Outdated
Show resolved
Hide resolved
editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.test.tsx
Outdated
Show resolved
Hide resolved
editor.planx.uk/src/@planx/components/MapAndLabel/test/utils.ts
Outdated
Show resolved
Hide resolved
editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.test.tsx
Outdated
Show resolved
Hide resolved
@@ -186,6 +186,22 @@ describe("validation and error handling", () => { | |||
}); | |||
// shows the error state on a tab when it's invalid | |||
}); | |||
|
|||
it("does not trigger handleSubmit when errors exist", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
What does this PR do?
Running through the Happy Path test to-dos. Tried to do a nice amount of refactoring to keep the testing concise but explicit, so I have some simple functions handling "Clicking Continue" and "Checking for Error Messages are Populated or Empty" since these are repeatable situations without a high amount of meaning or context for the test.
I would be interested to know if I should be waiting for a
handleSubmit()
to be called to confirm the happy path is successful rather than just checking the absence of error messages.