Repository navigation
test(fields): wait for the schema-typed range bound before asserting its number value - #35055
Conversation
…its number value
The stored-criteria `between` tests asserted `toHaveValue(5)` / `toHaveValue(1)`
straight after `findByLabelText('To')`. The widget seeds the row from the stored
value at once but types `age` as a number only when the async
`getObjectSchema` answers, so the first box found can still be the untyped
text box holding "5". Wait for the typed box itself (`spinbutton` role).
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz
|
repo:objectstack#3 · os-support-ai · session_01WGufzf35CD4CvA4nKbwwUn L1: ACCEPT This is the first L1 read of #35055 (card #34991) at the head above. The head merges cleanly with current main. Must-fixNone. Should-fixNone. Notes
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz
|
repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz Landing · 2026-11-18T01:50Z
Open findings: none. State: ready + auto-merge armed by area o3-D (lease Dev-effort: medium · Rounds: 1 |
🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz
Part of #34991
The card stays open: two sibling test files with the same race (
FilterConditionField.emptyOperators-10790,FilterConditionField.builderRows-8748) follow in a second PR under it (seat order 2026-11-18 00:31Z, claim amendment 6965218495).repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz
Clause-②: no
Metadata-protocol: none
维护者速读
spinbutton角色)出现后再断言toHaveValue(5)/toHaveValue(1)。age的 number 类型要等异步的getObjectSchema返回才生效;在那之前框是文本框,值是字符串 "5"。原测试findByLabelText拿到第一个框就断言,在慢机上与 schema 赛跑,队列构建 44173515593 因此误踢 PR feat(flow designer): add variables, say why Runs is empty, Debug takes the side column, and autosave reads 已保存 in the header #34955。ui/packages/fields/src/widgets/__tests__/FilterConditionField.betweenBlankBound-9914.test.tsx的findTypedBound及两处调用。getObjectSchema改成延迟 300ms 返回后跑pnpm --filter @object-ui/fields exec vitest run --root ../.. packages/fields/src/widgets/__tests__/FilterConditionField.betweenBlankBound-9914.test.tsx,预期 14/14 通过(修复前同样改动会在 :174 报5 (string))。What changes
The stored-criteria
betweentests asserted a typed value straight afterfindByLabelText.FilterConditionFieldseeds the row from the stored value at once, butageis typednumberonly when the asyncgetObjectSchemaanswers; until thenFilterBuilderdraws the bound as a text box holding"5". The test now waits for the typed box itself (findByRole('spinbutton', { name })), via one helperfindTypedBound, in both tests of this file that had the race (:174To, and:198Fromin the blank-bound migration test).No skip, no retry, no quarantine;
toHaveValue(5)andtoHaveValue(1)are unchanged.Widget reading: after the schema lands the bound IS a number input showing the number, so no product change and no changeset. The untyped text box exists only in the window before the schema answers (see Acceptance notes).
Tests
Reproduction: schema resolution delayed 300 ms (fails before, passes after)
Mutation landed with
scripts/ablation-replace.mjs(anchor hit 1, blob changed, restored to HEAD blob,git diff HEADempty), on the test-only anchorgetObjectSchema: async () => OBJECT_SCHEMAreplaced by a 300 mssetTimeoutpromise.Tests 2 failed | 12 passed (14).:174 expect(element).toHaveValue(5)Expected5 (number), Received5 (string), the queue signature exactly; and:198 toHaveValue(1)Received1 (string).Test Files 1 passed (1),Tests 14 passed (14).Package and neighbours at 6dffff8
@object-ui/fieldspackage (vitest run --root ../.. packages/fields/, under os-verify-lock):Test Files 307 passed | 1 skipped (308),Tests 4651 passed | 7 skipped (4658), VERDICT command-exit 0.FilterConditionField*files:Test Files 6 passed (6),Tests 128 passed (128).Acceptance notes
FilterConditionField.emptyOperators-10790.test.tsxfails 6 tests (findByDisplayValue('5')then an edit expects"amount":6, receives"amount":"6"), andFilterConditionField.builderRows-8748.test.tsxfails 1 (findAllByRole('combobox')thentoHaveTextContent('Name'), receives empty). Both are latent copies of this flake.getObjectSchemaanswers is emitted untyped (the emptyOperators probe above emits"amount":"6"). Measured only through the unit harness; not reached through a running app.type-check) and the full UI farm are left to CI (Type Check UI,Test UI).Verification
Derived gate families (dispatch-gates --commands, 27 commands)
All 26 non-vitest commands exit 0 at 6dffff8 (one
check:type-check-debtfirst run exited 3 while queued behind a held lock; rerun exit 0,0 raw tsc error(s) total).pnpm --dir ui exec vitest run scripts/(under os-verify-lock):Test Files 171 passed | 2 skipped (173),Tests 5077 passed | 2 skipped (5079), VERDICT command-exit 0.dispatch-gates --ran: 27 derived, 27 run, 0 NOT-MEASURED (a derived zero, every line carries its exit code).Generated by Claude Code