sadpandajoe commented on code in PR #43264:
URL: https://github.com/apache/superset/pull/43264#discussion_r3806972195
##########
superset-frontend/src/pages/ArchivedList/ArchivedList.test.tsx:
##########
@@ -273,6 +299,28 @@ test('name search refetches with a contains filter on the
name field', async ()
});
});
+test('a search that matches nothing shows the empty-state and no restore
actions', async () => {
+ // The list answers with zero rows regardless of query -- the assertion
+ // only needs to observe the empty state a filtered, empty result produces.
+ fetchMock.get(infoEndpoint, { permissions: ['can_read', 'can_write'] });
+ fetchMock.get(listEndpoint, { result: [], count: 0 });
+ renderArchivedList();
Review Comment:
Fixed in d811da1b74 — you're right, the mock returned an empty result
unconditionally for both the initial load and the post-search request, so the
test could pass without the search ever firing. Now the initial load returns
real data (`getOnce`), the search-triggered request specifically returns empty,
and the test asserts a request matching the search term was actually made
before checking the empty-state assertion (same pattern as the adjacent
name-search test). Independently re-verified: a fresh reviewer confirmed the
[email protected] `getOnce`/`get` ordering against the library's own source,
reproduced the negative check (temporarily disabling the search keypress) to
confirm the test now genuinely fails without a real search firing, and re-ran
it clean after a later master merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]