feat: add Load All button to fetch all data at once#23
Draft
cristinecula wants to merge 8 commits intomainfrom
Draft
feat: add Load All button to fetch all data at once#23cristinecula wants to merge 8 commits intomainfrom
cristinecula wants to merge 8 commits intomainfrom
Conversation
- Replace WTR with Vitest for test infrastructure - Add dual project setup: unit tests (jsdom) and storybook tests (browser) - Migrate unit tests (fetch, path) to Vitest syntax with vi.* mocks - Convert UI tests (render, item-click, use-pref) to Storybook interaction tests - Add @storybook/addon-vitest integration for browser-based testing - Update package.json scripts: test, test:unit, test:storybook, test:watch NEO-927
- Add @types/react for Storybook type definitions - Add skipLibCheck to tsconfig.json for Storybook type compatibility - Fix unused 'within' import in render.stories.ts - Fix window type casts in use-pref.stories.ts
- Create stories/helpers/render-hook.ts utility for testing Pion hooks - Use Storybook args pattern in render.stories.ts instead of window globals - Simplify use-pref.stories.ts using renderHook utility - Remove all window global usage from story tests
Replace local stories/helpers/render-hook.ts with @Neovici/testing@2.2.0 which now provides the same renderHook functionality for Pion hooks.
- Add HTML snapshots to RenderNavTest, RenderNavWithCallbacks, and RenderPaginationTest - Use vitest expect for snapshot assertions (storybook/test uses Chai which lacks snapshot support) - Snapshots capture DOM structure before user interactions
|
Move snapshot assertions out of story play functions to avoid vitest expect being bundled into the deployed Storybook UI, which caused 'Cannot read properties of undefined' errors. The interaction tests remain and provide sufficient coverage.
- Add loadAll function to use-more.ts that fetches all available data - Add Load All button to render-more.ts with onAll prop - Deprecate loading prop in favor of data$ for loading state - Wire up loadAll through use-list-core.ts and render-list-core.ts - Setup i18next in Storybook environment for translations - Add stories demonstrating Load More and Load All functionality - Update snapshots with translated button titles
910d8c7 to
9241c1d
Compare
Base automatically changed from
feature/neo-927-migrate-cosmoz-queue-tests-from-wtr-to-vitest
to
main
February 9, 2026 07:18
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
Implements NEO-926: Add a "Load All" button alongside the existing "Load More" button to fetch all available data in one request.
Changes
src/list/more/use-more.ts: AddloadAllfunction that fetches all data at once by requestingpageSize: totalAvailablesrc/list/more/render-more.ts: Add "Load All" button withonAllprop, deprecateloadingprop in favor ofdata$src/list/use-list-core.ts: Pass throughloadAllin return valuesrc/list/render-list-core.ts: Wire uploadAlltorenderLoadMore.storybook/preview.js: Setup i18next for Storybook environmentstories/load-more.stories.ts: Add stories demonstrating both buttonsBehavior
Testing
Notes
loadAllreplaces data instead of accumulating (re-fetches from beginning with scroll API)Closes NEO-926