chore(tables): replace hardcoded test data with deterministic fixtures#506
Merged
Merged
Conversation
Extracts the ad-hoc row arrays used by RuiDataTable stories and the example-app e2e suite into small generator functions driven by a fixed list of names/titles/roles, producing deterministic rows. Uses the same fixture set across stories and e2e so a test searching for "Alice" finds the same rows whether Storybook or Playwright is driving. Also fixes a stale-binding bug in the stories' `render`: `v-model:expanded`, `v-model:group` and `v-model:collapsed` bound to `args.*` directly instead of the `computed` refs returned from `setup`, so changes from the table wouldn't re-render. Now bound to the local computed refs. Adds eight stories that already work against the existing DataTable props: `WithSearch`, `RoundedSmall`, `RoundedLarge`, `DisabledRows`, `MultiPageSelect`, `CustomItemClass`, `HiddenHeaderAndFooter`, `GroupedWithExpandButtonEnd`. Useful for Storybook visual review and future interaction tests. Cherry-picked from rotki#492 — only the fixture / story-data portions; the broader DataTable decomposition stays in review.
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
Cherry-picks the fixture / story-data portions out of #492 so they can land independently of the broader DataTable decomposition.
Bug fix
The story `render` function's template bound `v-model:expanded`, `v-model:group`, `v-model:collapsed` to `args.*` directly while the `setup` block exposed matching `computed` refs that wrapped them. Changes coming back from the table didn't flow through the computed wrappers, so Storybook didn't re-render. Fixed by binding to the computed refs. (Same bug-fix as #492.)
Test plan