Skip to content

Initial creation of sv-react tests#171

Merged
hnn0003 merged 15 commits intomasterfrom
heather/add-react-tests
May 1, 2026
Merged

Initial creation of sv-react tests#171
hnn0003 merged 15 commits intomasterfrom
heather/add-react-tests

Conversation

@hnn0003
Copy link
Copy Markdown
Contributor

@hnn0003 hnn0003 commented Feb 13, 2026

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: a6cbdd4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@itwin/saved-views-react Patch

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-react unit 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.

Comment thread packages/saved-views-react/src/__tests__/translation/viewDetailsExtractor.test.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread package.json Outdated
Comment thread packages/saved-views-react/src/__tests__/createViewState.test.ts
Comment thread packages/saved-views-react/src/__tests__/createViewState.test.ts
Comment thread packages/saved-views-react/src/__tests__/translation/extractionUtilities.test.ts Outdated
Comment thread .changeset/loud-ends-hang.md
@hnn0003 hnn0003 merged commit aa9bab6 into master May 1, 2026
4 checks passed
@hnn0003 hnn0003 deleted the heather/add-react-tests branch May 1, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants