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

Event feature testing #2021

Merged
merged 8 commits into from
Jun 16, 2024
Merged

Conversation

ziggabyte
Copy link
Contributor

Description

This PR started out as working on #1994 but evolved into the start of a way to test whole features. This is not a complete test suite that covers all states and situations an event goes through, but it is a beginning to figuring out ways to make hour hooks and stores testable together.

Screenshots

Behold the glorious absence of spinner 😅
bild

Changes

  • Adds tests for creating, updating and deleting an event
  • Adds a file of test utils
  • Adds timestamps for when an event item and list were loaded
  • Changes the return type of the useEvent hook to return null when the requested event is deleted
  • Changes the useEventsFromDateRange hook to become testable by taking in orgId and campId instead of using useNumericRouteParams (no router to get params from inside the test heh)

Notes to reviewer

none

Related issues

Resolves #1994 (once and for all, hopefully)

@ziggabyte ziggabyte requested review from rebecarubio and richardolsson and removed request for rebecarubio June 13, 2024 09:32
richardolsson
richardolsson previously approved these changes Jun 14, 2024
Copy link
Member

@richardolsson richardolsson left a comment

Choose a reason for hiding this comment

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

Awesome work! I have no required changes, but some suggestions below. 💯

src/features/events/utils/testUtils.tsx Outdated Show resolved Hide resolved
src/features/events/tests/createEvent.spec.tsx Outdated Show resolved Hide resolved
src/features/events/tests/createEvent.spec.tsx Outdated Show resolved Hide resolved
Copy link
Member

@richardolsson richardolsson left a comment

Choose a reason for hiding this comment

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

I have looked at the recent changes and they look good. I think it's time to merge!

@richardolsson richardolsson merged commit 2927f70 into main Jun 16, 2024
5 checks passed
@richardolsson richardolsson deleted the undocumented/event-feature-testing branch June 16, 2024 10: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.

Calendar : endless spinner in day view
2 participants