Skip to content
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

[Storage] Validate errors on create bucket modal test #2224

Conversation

juans-chainsafe
Copy link
Contributor

closes #2221

@juans-chainsafe juans-chainsafe added the Type: Maintenance Added to issues and PRs when a change is for repository maintenance , such as CI or linter changes. label Jul 14, 2022
@juans-chainsafe juans-chainsafe self-assigned this Jul 14, 2022
@render
Copy link

render bot commented Jul 14, 2022

@render
Copy link

render bot commented Jul 14, 2022

@render
Copy link

render bot commented Jul 14, 2022

bucketsPage.createBucketButton().click()
createBucketModal.body().should("be.visible")
// ensure can't create an empty bucket
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing but I find that leaving a whitespace before each comment / individual check in the flow of the test helps readability, it's not done here but is elsewhere in the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! it helps, done!

bucketsPage.createBucketButton().click()
createBucketModal.body().should("be.visible")
// ensure can't create an empty bucket
createBucketModal.submitButton().click()
createBucketModal.bucketNameInput().should("have.class", "error")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I've never thought about using the class name before like this. I would usually avoid doing that (as I'd be concerned about it being too generic and potentially picking up a false match from elsewhere on the page)...but you've scoped it to within the bucketNameInput element so I guess that's not a valid concern, nice! 🤩

Copy link
Contributor Author

@juans-chainsafe juans-chainsafe Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! the other way around is checking that the modal is still present and validating the text... but we don't want to add validations that have hardcoded text, so I ended up doing that inside the input, so we shouldn't have any problem. Also, I added a validation when the input is correct that the class 'error' should not be present

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@asnaith asnaith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for this.

@juans-chainsafe juans-chainsafe merged commit 89d88b7 into dev Jul 15, 2022
@juans-chainsafe juans-chainsafe deleted the mnt/validate-errors-when-trying-to-create-bucket-test--2221 branch July 15, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Added to issues and PRs when a change is for repository maintenance , such as CI or linter changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Storage] Add validate errors when trying to create a bucket test
3 participants