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

Remove implicit @testing-library get* assertions: v-modal.spec.js #2321

Closed
sarayourfriend opened this issue Jun 4, 2023 · 0 comments · Fixed by #4018
Closed

Remove implicit @testing-library get* assertions: v-modal.spec.js #2321

sarayourfriend opened this issue Jun 4, 2023 · 0 comments · Fixed by #4018
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend

Comments

@sarayourfriend
Copy link
Collaborator

sarayourfriend commented Jun 4, 2023

Current Situation

See #2198 for description of issue.

Suggested Improvement

Remove the expect(...).not.toThrow() wrapper and use explicit assertions for each expected element.

Example transformations:

expect(() => {
  screen.getByRole("button") // throws if not present
  screen.getByRole("dialog") // throws if not present
}).not.toThrow()

should be

expect(screen.findByRole("button")).toBeInTheDocument()
expect(screen.findByRole("dialog")).toBeInTheDocument()

Lines that need to be changed

expect(() => screen.getByText(/custom initial focus/i)).not.toThrow()

Benefit

See #2198

@sarayourfriend sarayourfriend added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository 🧱 stack: frontend Related to the Nuxt frontend labels Jun 4, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog Jun 4, 2023
@obulat obulat added good first issue New-contributor friendly help wanted Open to participation from the community labels Oct 20, 2023
@obulat obulat moved this from 📋 Backlog to 📅 To Do in Openverse Backlog Mar 25, 2024
@obulat obulat self-assigned this Mar 25, 2024
@openverse-bot openverse-bot moved this from 📅 To Do to 🏗 In Progress in Openverse Backlog Apr 3, 2024
@openverse-bot openverse-bot moved this from 🏗 In Progress to ✅ Done in Openverse Backlog Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants