Repository navigation
Conversation
This was referenced Oct 29, 2026
r0b1n
force-pushed
the
feat/combobox-selector-safety-net
branch
from
October 30, 2026 08:34
d7cf817 to
b6e38a2
Compare
r0b1n
force-pushed
the
feat/combobox-selector-safety-net
branch
from
October 30, 2026 08:57
4720a03 to
e251deb
Compare
r0b1n
force-pushed
the
feat/combobox-selector-safety-net
branch
from
October 30, 2026 08:58
e251deb to
ca117d9
Compare
r0b1n
marked this pull request as ready for review
October 30, 2026 09:36
This comment has been minimized.
This comment has been minimized.
Simple-type props only change on a redeploy, never between re-renders. Stores can read them once as plain fields and tests must not change them between renders.
Covers every selector family, getSelector, BaseOptionsProvider filtering, LazyLoadProvider, datasourceFilter and the useGetSelector hook with tests written against the current behaviour, so the helpers layer can be refactored safely. Pinned quirks are marked in the tests and rated in the OpenSpec change. Suite goes from 61 to 194 tests, snapshots untouched.
LazyLoadProvider.spec passed string literals where ValueStatus is expected and useGetSelector.spec cast an ActionValue to an incompatible type. Jest runs through swc without type checking, so only tsc --noEmit saw it.
…list builder actionValue takes the ActionValue type as a type parameter so actions with parameters need no cast. ListValueBuilder gains withLimit and withSortOrder, and isUnavailable now sets the unavailable status instead of loading. listAttribute accepts an optional attribute id.
…of casts The characterisation specs set status, items, limit, sort order, validation and attribute ids by casting mocks to ad-hoc shapes. They now use the builders, the typed attrId helper and the generic actionValue. No expectation changed.
The lazy loading scenario in SingleSelection and MultiSelection built an untyped props object with an enum cast. It is now a ComboboxContainerProps and the cast and its import are gone.
r0b1n
force-pushed
the
feat/combobox-selector-safety-net
branch
from
October 30, 2026 13:30
ca117d9 to
2a2a4ee
Compare
Contributor
AI Code Review
What was reviewed
Skipped (out of scope): none CI: pending: Run code quality check, sigridci, triage, Plan E2E matrix · unrelated failures: security/snyk (external scanner, and the diff touches no production code) Questions
Positives
|
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.
Pull request type
Description
Unit test improvements for
combobox-web, with no production code change and no dependency on any other work. Everything here is useful on its own.Characterisation tests at the selector seam. The selectors, options providers and captions providers under
src/helpers/are the combobox model, and they were only tested indirectly through the React components. This PR adds tests written against the current behaviour for every family (association single and multi, enumeration and boolean, static, database single and multi), plusgetSelector,BaseOptionsProviderfiltering,LazyLoadProvider,datasourceFilterand theuseGetSelectorhook seam. Shared props fixture insrc/helpers/__tests__/fixtures.ts. OpenSpec changecombobox-selector-safety-netin the package.A mutation check (one deliberate break per family, reverted) confirmed each family is caught. Behaviour the tests found questionable is pinned with a
// Quirk:comment and rated in the change'sdesign.md. Three are real bugs for their own follow-up changes: stalecurrentIdin the static selector on external clear, descending chip sort when the datasource has no sort order, and the database multi selector never forcing the boxes style.Test utils (
@mendix/widget-plugin-test-utils, source compatible for all existing callers):actionValuetakes the action type as a type parameter so actions with parameters need no cast;ListValueBuildergainswithLimitandwithSortOrder, and itsisUnavailablenow sets the unavailable status (it set loading, unused until now);listAttributeaccepts an optional typed id. Each addition has a test.Spec hygiene. The new specs and the two existing component specs build their mocks through the builders and typed props objects instead of casting mocks to ad-hoc shapes.
pnpm exec tsc --noEmit -p tsconfig.jsonis clean in the package; Jest runs through swc without type checking, so this is worth running before pushing specs.Agent documentation.
docs/requirements/backend-structure.mdrecords that simple-type widget props are constants for the lifetime of a widget instance, with the consequence for stores and tests.Testing
pnpm run testincombobox-web: 16 suites, 194 tests, 5 snapshots unchanged (no-u).pnpm run testinwidget-plugin-test-utils: 52 tests.pnpm run lintin both: 0 errors, remaining warnings pre-existing in untouched files.