-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(zones): fetch zones using react-query MAASENG-3404 #5485
feat(zones): fetch zones using react-query MAASENG-3404 #5485
Conversation
27fc75b
to
6a27b1a
Compare
119a8bb
to
08def15
Compare
25b9078
to
c5b20bc
Compare
Looks like lint is failing on this at the moment |
Please have a look regardless, this PR is pretty big. :) |
7b10cef
to
5ad8dac
Compare
}); | ||
|
||
const { findByText } = within( | ||
await screen.findByTestId("section-header-title") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason that you're using findBy
instead of getBy
in these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findBy is an equivalent of calling waitFor(() => expect(() => screen.getBy
https://testing-library.com/docs/dom-testing-library/api-async#findby-queries
payload: { | ||
params: { system_ids: ids }, | ||
}, | ||
}) as const, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for adding all of these as const
in the slices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, the type for websocket actions ended up being string instead of a literal. Adding as const ensures that the action type/method is inferred as a specific string literal rather than the more general string type.
QA is looking good. New zones / modified zones have a bit of delay in waiting for the changes to propagate, but that might just be my slow connection |
1adbed8
to
6657f2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, should be good to merge as soon as CI passes 👍
06c4793
to
8b4bfc4
Compare
8b4bfc4
to
bf39ecf
Compare
Done
This PR introduces React Query for managing zone-related data fetching and caching.
WebSocketEndpoints
detailing allowed WebSocket endpoint models and methodsuseZoneById
hook for fetching zones by IDrenderWithBrowserRouter
to returnstore
andqueryClient
for more concise testsQA steps
Fixes
Fixes: MAASENG-3404