Conversation
🦋 Changeset detectedLatest commit: a6cbdd4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds an initial Vitest-based test suite for @itwin/saved-views-react, including translation/extraction utilities and higher-level saved view capture/apply/view-state creation flows, plus supporting mocks/fixtures and config updates.
Changes:
- Add comprehensive
saved-views-reactunit tests (translation extractors, clip vectors, extensions, display styles, create/apply/capture flows) with snapshots. - Add test mocks/fixtures for iTwin frontend/iModel objects and payloads.
- Update tooling/config (Vitest aliasing, typecheck/build tsconfigs, dependency override bumps, changeset).
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Lockfile updates for bumped overrides and platform metadata. |
| packages/saved-views-react/vitest.config.ts | Adds Vite/Vitest alias so tests can resolve @itwin/saved-views-client to workspace source. |
| packages/saved-views-react/tsconfig.typecheck.json | Adds dedicated typecheck config excluding tests. |
| packages/saved-views-react/tsconfig.build.json | Adjusts build exclusions and clarifies path-mapping behavior for build vs typecheck. |
| packages/saved-views-react/src/tests/translation/viewDetailsLegacyExtractor.test.ts | Adds tests + snapshots for legacy viewDetails extraction. |
| packages/saved-views-react/src/tests/translation/viewDetailsExtractor.test.ts | Adds tests + snapshots for viewDetails extraction. |
| packages/saved-views-react/src/tests/translation/extractionUtilities.test.ts | Adds tests for extraction helper functions and color transforms. |
| packages/saved-views-react/src/tests/translation/extensionExtractor.test.ts | Adds tests for extension JSON parsing/extraction. |
| packages/saved-views-react/src/tests/translation/displayStyleExtractor.test.ts | Adds extensive tests + snapshots for display style extraction (schema + legacy). |
| packages/saved-views-react/src/tests/translation/clipVectorsLegacyExtractor.test.ts | Adds tests for legacy clip-vector extraction and validity checks. |
| packages/saved-views-react/src/tests/translation/clipVectorsExtractor.test.ts | Adds tests + snapshots for clip-vector conversion to legacy format. |
| packages/saved-views-react/src/tests/translation/snapshots/viewDetailsLegacyExtractor.test.ts.snap | Stores snapshots for legacy viewDetails extraction. |
| packages/saved-views-react/src/tests/translation/snapshots/viewDetailsExtractor.test.ts.snap | Stores snapshots for viewDetails extraction. |
| packages/saved-views-react/src/tests/translation/snapshots/displayStyleExtractor.test.ts.snap | Stores snapshots for displayStyle extraction. |
| packages/saved-views-react/src/tests/translation/snapshots/clipVectorsExtractor.test.ts.snap | Stores snapshots for clipVectors extraction. |
| packages/saved-views-react/src/tests/mocks/itwinFrontendMocks.ts | Adds reusable @itwin/core-frontend mocks for tests. |
| packages/saved-views-react/src/tests/mocks/iModelMocks.ts | Adds reusable iModel/viewport mocks for tests. |
| packages/saved-views-react/src/tests/fixtures/savedViewPayloads.ts | Adds saved view payload fixtures for apply/capture tests. |
| packages/saved-views-react/src/tests/fixtures/legacyViewPayloads.ts | Adds legacy payload fixtures for conversion tests. |
| packages/saved-views-react/src/tests/createViewState.test.ts | Adds tests for view state creation paths and selector mutation behavior. |
| packages/saved-views-react/src/tests/captureSavedViewData.test.ts | Adds tests for capture logic, extensions, and query fallbacks. |
| packages/saved-views-react/src/tests/applySavedView.test.ts | Adds tests for apply logic, settings branches, and extension handling. |
| packages/saved-views-react/package.json | Updates typecheck script to use new typecheck tsconfig. |
| package.json | Bumps overrides (axios, qs). |
| .changeset/loud-ends-hang.md | Changeset declaring a minor bump for adding tests. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 6 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Create a set of tests for saved-views-react.
Used AI to run a comparison between sv-util/sv-service & sv/sv-react code, focusing on extraction/translation code and the tests thereof. Seemed to think things were pretty good (not that that comparison is perfect), save for one issue with in the clipVectors where sv-util is transforming 2d clip vector points to 3d with z=0 while sv-react will just set a 2d clip vector to undefined if it's looking for a 3d clip vector. I think this issue would be better tackled in a separate PR, so I created a separate issue here for it: #174
TEST_PLAN_COMPARISON_RESEARCH_2.md