Repository navigation
test(creators): add integration test for search no-results state - #1100
Merged
Chucks1093 merged 1 commit intoOct 17, 2026
Merged
Chucks1093 merged 1 commit into
Chucks1093 merged 1 commit into
Conversation
Cover the marketplace creator list when a search returns zero matches: the dedicated "No creators found" state references the search term, is distinct from the generic "No creators available" empty state, and is removed once the search input is cleared. Closes accesslayerorg#675 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Nife-tanny Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an integration test for the marketplace creator list on
LandingPage. When a creator search returns zero matches, the page must show a dedicated no-results state that references the search term, separate from the generic empty state.The no-results UI already existed, so this PR is test-only and has no production code changes:
EmptyStatewith the status label "No creators found" and the descriptionWe couldn't find any creators matching "<term>"…ClearedFiltersEmptyStatewith the status label "No creators available" and the heading "Nothing here yet"Closes #675
Changes
src/pages/__tests__/LandingPage.searchNoResults.integration.test.tsxTest 1: shows a no-results state referencing the search term and removes it when the search is cleared
courseService.getCoursesto return[]when called withsearch: 'zzznomatch', and one creator otherwise.zzznomatchin the search input and waits for the debounced API call with that search param. It useswaitFor, with no sleeps or fake timers."zzznomatch", and that no creator cards are rendered.searchparam. Asserts the no-results state is gone and the creator list is back.Test 2: renders the generic empty state without search-term copy when no search term is active
?category=Nonexistentand no search term. Asserts the "No creators available" state appears, contains none of the no-results copy, and the no-results state is absent. Together with test 1, this checks the two states are separate in both directions.The test follows the existing
LandingPage.*.integration.test.tsxconventions:vi.mockfor the service and heavy children, aQueryClientProviderplusMemoryRouterwrapper, and accessiblegetByRole/getByPlaceholderTextqueries. It adds no new dependencies or test ids.Notes on test design
waitFor: while a fetch is in flight,SearchBarreplaces its<input>with a skeleton, and the list briefly shows "Updating results...". A smallwaitForSettledListhelper waits for both to clear and asserts against live queries, never stored element references. Without this the test was flaky.fireEvent.changeinstead of per-keyuserEvent.type: this matches the other LandingPage search tests. With per-key typing, rendering this page in jsdom is slow enough (about 250ms per key) to reach the 300ms debounce mid-word. The input then unmounts, and later keystrokes hit<body>; thetin "zzznomatch" opens the trade dialog through theTshortcut.Testing
sh ./scripts/check-no-package-lock.shpnpm lintpnpm build(tsc -b && vite build)tsconfig.app.jsonexcludes tests)prettier --checkon the new fileLandingPageto always render the generic empty statepnpm test(full suite)dev(see below)Unrelated test failures already on
devThis PR changes no source files, so these failures are already on
devand are unrelated to #675. I haven't touched them.The full
pnpm testrun took about 41 minutes locally, becausevitest.config.tsforcesmaxWorkers: 1andfileParallelism: false. Final result:The new
LandingPage.searchNoResults.integration.test.tsxpassed in the full run. None of the 12 unhandled errors come from it. Those errors come fromLandingPage.buyFlowEndToEnd,holdingsTradeSequence,sellConfirmationModal,sellFlowandtradeConfirmToast.62 failing test files (click to expand)
src/components/common/__tests__/ConnectWalletButton.test.tsx: 21 tests | 14 failedsrc/components/common/__tests__/CreatorCard.accessibility.test.tsx: 2 tests | 2 failedsrc/components/common/__tests__/CreatorCard.props.test.tsx: 5 tests | 2 failedsrc/components/common/__tests__/CreatorCard.sparkline.test.tsx: 4 tests | 4 failedsrc/components/common/__tests__/CreatorProfileHeader.copy.test.tsx: 2 tests | 2 failedsrc/components/common/__tests__/DeprecationBanner.test.tsx: 5 tests | 5 failedsrc/components/common/__tests__/EmptySearchSuggestions.test.tsx: 5 tests | 1 failedsrc/components/common/__tests__/GlobalSearch.test.tsx: 12 tests | 1 failedsrc/components/common/__tests__/GraduatedCurvePanel.test.tsx: 3 tests | 3 failedsrc/components/common/__tests__/ReferralLinkPanel.test.tsx: 1 test | 1 failedsrc/components/common/__tests__/StakeForm.test.tsx: 9 tests | 1 failedsrc/components/common/__tests__/TradeConfirmationModal.test.tsx: 4 tests | 1 failedsrc/components/common/__tests__/TradeDialog.circuitBreaker.test.tsx: 6 tests | 1 failedsrc/components/common/__tests__/TradeDialog.clamp.integration.test.tsx: 8 tests | 2 failedsrc/components/common/__tests__/TradeDialog.confirmationFees.integration.test.tsx: 7 tests | 1 failedsrc/components/common/__tests__/TradeDialog.features.test.tsx: 7 tests | 3 failedsrc/components/common/__tests__/TradeDialog.holdingCap.test.tsx: 10 tests | 8 failedsrc/components/common/__tests__/TradeDialog.mobileSheet.test.tsx: 5 tests | 2 failedsrc/components/common/__tests__/TradeDialog.slippageControls.test.tsx: 7 tests | 3 failedsrc/components/common/__tests__/WalletActivityFeed.infiniteScroll.integration.test.tsx: 4 tests | 4 failedsrc/components/creator/__tests__/FundRewardPoolForm.test.tsx: 5 tests | 1 failedsrc/hooks/__tests__/useRecentlyViewed.test.ts: 8 tests | 1 failedsrc/hooks/__tests__/useTheme.test.ts: 15 tests | 10 failedsrc/hooks/__tests__/useTradeKeyboardShortcuts.test.ts: 19 tests | 1 failedsrc/lib/web3/format.test.ts: 4 tests | 2 failedsrc/pages/__tests__/CreatorDetailPage.buyKeyFlow.integration.test.tsx: 3 tests | 1 failedsrc/pages/__tests__/CreatorDetailPage.integration.test.tsx: 8 tests | 1 failedsrc/pages/__tests__/CreatorDetailPage.tradeCooldown.integration.test.tsx: 3 tests | 2 failed | 1 skippedsrc/pages/__tests__/CreatorDetailPage.whitelist.test.tsx: 5 tests | 1 failedsrc/pages/__tests__/CreatorProfilePage.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.apiErrorToast.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.buyFlowEndToEnd.integration.test.tsx: 4 tests | 1 failedsrc/pages/__tests__/LandingPage.cardCount.integration.test.tsx: 7 tests | 7 failedsrc/pages/__tests__/LandingPage.debouncedSearchClear.integration.test.tsx: 2 tests | 2 failed (expectsgetCourses(undefined)/{ search }, but the page now always sendssort)src/pages/__tests__/LandingPage.emptyState.integration.test.tsx: 3 tests | 3 failed (its@/hooks/useWalletmock is missinguseSelfFreezeMutation)src/pages/__tests__/LandingPage.holdings.test.tsx: 3 tests | 3 failedsrc/pages/__tests__/LandingPage.holdingsCount.integration.test.tsx: 3 tests | 3 failedsrc/pages/__tests__/LandingPage.holdingsEmptyState.test.tsx: 2 tests | 2 failedsrc/pages/__tests__/LandingPage.holdingsEmptyStateSkeleton.integration.test.tsx: 2 tests | 2 failedsrc/pages/__tests__/LandingPage.holdingsGrandTotal.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.holdingsGrandTotalSum.integration.test.tsx: 4 tests | 4 failedsrc/pages/__tests__/LandingPage.holdingsLoadingSkeleton.integration.test.tsx: 2 tests | 2 failedsrc/pages/__tests__/LandingPage.holdingsSellBalanceUpdate.integration.test.tsx: 4 tests | 4 failedsrc/pages/__tests__/LandingPage.holdingsWalletSwitch.integration.test.tsx: 3 tests | 3 failedsrc/pages/__tests__/LandingPage.portfolio.test.tsx: 9 tests | 9 failedsrc/pages/__tests__/LandingPage.portfolioHistory.integration.test.tsx: 3 tests | 3 failedsrc/pages/__tests__/LandingPage.portfolioPnl.integration.test.tsx: 4 tests | 4 failedsrc/pages/__tests__/LandingPage.priceFilters.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.scrollRestoreBackNav.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.searchAndSort.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.searchDebounceUnit.test.tsx: 3 tests | 3 failedsrc/pages/__tests__/LandingPage.sharePerformance.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.sort.integration.test.tsx: 2 tests | 2 failedsrc/pages/__tests__/LandingPage.sortResetPage.integration.test.tsx: 2 tests | 1 failedsrc/pages/__tests__/LandingPage.tradeConfirmToast.integration.test.tsx: 2 tests | 1 failedsrc/pages/__tests__/LandingPage.tradeShortcut.test.tsx: 4 tests | 4 failedsrc/pages/__tests__/LandingPage.tradeShortcutUnmount.integration.test.tsx: 1 test | 1 failedsrc/pages/__tests__/LandingPage.tradeSubmitDisabled.integration.test.tsx: 4 tests | 4 failedsrc/pages/__tests__/NotFoundPage.integration.test.tsx: 1 test | 1 failedsrc/providers/__tests__/Web3Provider.test.tsx: 1 test | 1 failedsrc/utils/__tests__/portfolioValue.pnl.test.ts: 40 tests | 1 failedsrc/utils/__tests__/toast.transactionSuccess.test.tsx: 7 tests | 2 failedCI (
.github/workflows/ci.yml) runs only lint and build, both of which pass. It doesn't runpnpm test.Other observations (not addressed here)
SearchBarreplaces its input with a skeleton wheneverisLoadingis true. A slow typer can pause longer than the 300ms debounce mid-word, and the input then unmounts and loses focus. Later keystrokes go to the page, where single-letter shortcuts (B/S/T) can open the trade dialog. This could deserve its own issue.TradeDialogcallscourseService.getDynamicFeeRate. Tests that mockcourseServicewith onlygetCoursesget an unhandled error if the dialog opens.vitest.config.tsdefines theexcludekey twice, which esbuild warns about.🤖 Generated with Claude Code