Repository navigation
HDDS-9793. [Recon][UI][Test] Add tests for Containers page - #11417
Conversation
chihsuan
left a comment
There was a problem hiding this comment.
Thanks for working on this! @sravani-revuri The structure looks good and matches the other Recon tests nicely.
I tried breaking the behavior each test names, and a few still pass. See inline for details.
| return { | ||
| ...actual, | ||
| useApiData: <T,>(url: string, defaultValue: T, options = {}) => { | ||
| if (url === '/api/v1/clusterState') { |
There was a problem hiding this comment.
nit: Is this special case needed? The mock server already handles this endpoint, and the tests still pass for me without it.
There was a problem hiding this comment.
The server already handles /api/v1/clusterState and the test assertions do pass, but vitest run reports unhandled CanceledErrors on that URL without this check . Containers fetches clusterState twice on mount (initialFetch: true + clusterState.refetch() from autoReload), so the second request aborts the first and that rejection isn’t caught. I checked out how pipelines is doing it and it uses initialFetch: false instead hence it doesn't face this problem.
I've currently added a comment to justify this, happy to drop / modify in a follow-up accordingly.
There was a problem hiding this comment.
Thanks for digging into this! @sravani-revuri The double fetch also happens on the page itself, so I've opened HDDS-16877 as a follow-up, and #11484 fixes it. Since this PR will merge first, we can drop the special case in #11484.
smengcl
left a comment
There was a problem hiding this comment.
The 12 tests pass locally, but the suite also passes with these deliberate regressions:
- An empty API response incorrectly produces a row: the empty-state assertion passes against the initial “No Data” placeholder.
- The Quasi Closed highlight shows
N/A: the whole-card match for2also matches20or25. - Tab data loads eagerly on mount or reloads on every visit: the lazy-loading tests only check that rows eventually appear.
Could we strengthen these assertions before merging? The existing inline threads already cover the highlight and lazy-loading gaps.
smengcl
left a comment
There was a problem hiding this comment.
Thanks for the update. lgtm
chihsuan
left a comment
There was a problem hiding this comment.
Thanks @sravani-revuri for the patch, @smengcl for the review.
What changes were proposed in this pull request?
This task adds test for the container page on recon UI
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9793
How was this patch tested?
Ran tests.