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

Tests #57

Merged
merged 27 commits into from
Apr 15, 2024
Merged

Tests #57

merged 27 commits into from
Apr 15, 2024

Conversation

daun
Copy link
Member

@daun daun commented Apr 14, 2024

Description

  • Add tests and fix a few issues discovered during testing
  • Turns out we can test the whole plugin just in vite, same as the head plugin
  • Avoiding Playwright for as long as possible makes things much simpler and faster 🧃

Changes

  • Straighten out a few types
  • Make swup.announce() return a Promise to simplify testing
  • Check reduced-motion option just-in-time to simplify testing
  • Extract announcement delay into documented variable

Fixes

  • Re-implement language fallback
  • Fix selector for [inert] autofocus element

Checks

  • The PR is submitted to the master branch
  • The code was linted before pushing (npm run lint)
  • All tests are passing (npm run test)
  • New or updated tests are included
  • The documentation was updated as required

Notes

Closes #58

@daun daun marked this pull request as ready for review April 14, 2024 21:50
@daun daun requested a review from hirasso April 14, 2024 21:53
hirasso
hirasso previously approved these changes Apr 15, 2024
Copy link
Member

@hirasso hirasso left a comment

Choose a reason for hiding this comment

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

Amazing work! It's beautiful reading through the tests.

tests/unit/announcements.test.ts Show resolved Hide resolved
src/announcements.ts Outdated Show resolved Hide resolved
Copy link
Member

@hirasso hirasso left a comment

Choose a reason for hiding this comment

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

🍰

@daun daun merged commit 3f3a78b into master Apr 15, 2024
1 check passed
@daun daun deleted the chore/tests branch April 15, 2024 11:52
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

Successfully merging this pull request may close these issues.

[Bug]: Language fallback no longer working
2 participants