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

Test missing expected wrapper #3513

Closed
jcoyne opened this issue May 3, 2024 · 1 comment
Closed

Test missing expected wrapper #3513

jcoyne opened this issue May 3, 2024 · 1 comment

Comments

@jcoyne
Copy link
Contributor

jcoyne commented May 3, 2024

Capybara gives this warning when running the tests:

Modal window with text `Deposit will be enabled once files have finished uploading` has been opened, but you didn't wrap your code into (`accept_prompt` | `dismiss_prompt` | `accept_confirm` | `dismiss_confirm` | `accept_alert`), accepting by default
@justinlittman
Copy link
Contributor

This is caused by https://github.com/sul-dlss/happy-heron/blob/main/app/javascript/controllers/dropzone_controller.js#L148

It seems like a race condition in which the deposit button is being clicked before the file upload is completed.

But here's what's weird: You'd expect the test to fail (even if the alert is accepted by default) since the form submit should be stopped. (I verified that behavior running locally by adding a delay into the controller.) But the test completes successfully, indicating that the form was submitted. No idea how to account for this.

Unfortunately, I couldn't find anyway in capybara to handle an alert that might occur. The suggested wrappers handle when an alert must occur.

Open to other suggestions, otherwise we should just live with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants