You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 23df5c7
Browse filesBrowse the repository at this point in the historyBrowse files
test(cli,showcase): two nightly-tier tests read the product as merged: the R5 field group, and no stage strip (#36028)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuVwX4pUdM1qvNLSqRZNSvv3)_
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv
Fixes#36007
Clause-②: no (tests only)
Metadata-protocol: none
Skills-docs: none
## 维护者速读
- 用户无感:只改了六份测试,产品本身一行没动,夜间测试恢复全绿。
-
为什么做:近期几次已合并的改版(记录页去掉阶段条、明细行改由父对象字段分组内嵌、明细表格去掉空白录入行、新加的明细行在点保存前不标红)让这些测试过时,夜间测试在主干上报红或即将报红。
- 出错会怎样:最坏是测试漏掉某个记录页回归;改动只在测试里,可直接撤回。
- 要你做什么:无。
## What changes
Six test files lag merges that changed the product on purpose. The
product is not touched; each test now reads what the product draws
today.
**`packages/cli/test/lint-strict-warnings.e2e.test.ts`.** Since the
change that made a parent field group, not the FK's `inlineEdit`,
satisfy `relationship/line-items-inline-edit` (R5,
`packages/lint/src/data-model-rules.ts`), the `clean` fixture drew one
suggestion and `total` was 1. The fixture's `adviseMaster` knob now also
gives the parent invoice a field group that places the line
(`fieldGroups: [{ key: 'lines', label: 'Lines', relatedList: 'NS_line'
}]`). `inlineEdit: true` stays: it still picks the form factor, and is
spec-legal. The `stack()` doc comment says which two suggestions
`adviseMaster: false` produces now. Every row of the header table was
re-measured on this branch (`os lint --json` on each generated fixture);
no row moved:
| fixture | errors | warnings | suggestions | rules (measured) |
|---|---|---|---|---|
| warns | 0 | 2 | 0 | `protocol/missing-engines-range`,
`relationship/master-detail-required` |
| suggests | 0 | 0 | 2 | `relationship/delete-behavior`,
`relationship/line-items-inline-edit` |
| errs | 1 | 1 | 0 | `list-view-field-unknown`,
`protocol/missing-engines-range` |
| clean | 0 | 0 | 0 | none |
**`examples/app-showcase/e2e/detail-shapes.spec.ts`.** The default
record page no longer draws the `Record path` stage strip or the `Record
highlights` key-field strip. The stage now shows as the header tag
`data-record-stage-tag=FIELD`, and highlighted fields stay in their
groups. The record page also has a tab row (`data-record-tab=ID`) and
the 概览 rail (`RecordSummaryRail`). Each check was verified against the
ui source and a real run:
- **grouped (zoo):** the stage-strip wait is replaced by the header tag
reading `Active` (from `stageField: 'status'`), and both strips are
asserted absent. Highlighted members stay in their groups: Status is in
Basics, and amount `4,200` is hidden with Budget inside the collapsed
Money group, then visible once it is opened. Group icon, description and
the `$` currency checks are unchanged. **Dropped:** "the strip does not
repeat the record title". The strip it tested no longer exists.
- **stageField:false (legacy zoo):** "no stepper" becomes "no stage tag
at all", and the stepper and strip stay asserted absent.
- **related-heavy (Contoso):** renamed from "ungrouped + related-heavy".
The stage tag replaces the stepper. The tab row opens on `overview`. The
`relatedList: 'primary'` lists (Invoices, Projects) are body tables with
no tab of their own, and a new positive control
(`showcase_contact.account` tab present) shows that this absence check
uses a real id. The Contacts rail card reads Carl Fox through
`[data-record-summary-row]`, and the footer and `$25,000,000` checks
remain (now scoped to the details). **Dropped:** "no tier draws a tab
strip", which the tab row made false; "动态 is the last right-column panel
(`data-record-timeline-panel`)", because the rail has no such panel (its
activity card is hidden when there is no activity); and the "ungrouped /
Contoso declares no fieldGroups / Basics count 0" shape, because
`showcase_account` now declares fieldGroups and it is replaced by "its
Profile group renders".
**Four Console live specs (`ui/e2e/live/`, run nightly by
`examples/app-showcase/test/console-live-specs.live.test.ts`).** These
were not yet red on the 2026-11-21 nightly (run 44871440181 at
`98b3f87e`). They failed 4 of 28 on `141a826f`. Each one waited for a
first line-row input in an empty grid (`getByTestId('line-items')
input[aria-label="Qty"]`), and the page shows instead the empty-grid
hint `No items yet — click "Add line" to begin.` above the `Add line`
button. **Cause: ec24363 (#35998)**, which removed the always-present
blank ("ghost") entry row from `GridField` on purpose (fixes#35507). An
empty editable grid now shows that hint, and Add appends a line and
focuses it. With Add clicked first, three specs pass unchanged, which
shows the Add path and the defaults path (32409a9, #35984) still work:
the rows appear, the product pick auto-fills, the computed amount,
document totals and the atomic batch are correct, and the upload
persists. The fourth spec had a second, also intended cause. Since
32409a9 (#35984, `newRowRequiredShown={saveTried}` in
`MasterDetailForm`, from #35816 / #35940), a line just added reads no
required cell red until a save of the form is tried, and a
`requiredWhen` verdict goes through the same `required` flag. Each spec
keeps its intent:
- `form-view-subforms.spec.ts`: clicks Add line (shared `addLineItem`
helper), then picks the product on the new row. The docblock bullet "the
trailing ghost row, no Add line click" now reads "Add line appends an
editable row". The final assertion, exactly one line persisted, now
means "the one line added and filled", not "the empty ghost was not
persisted".
- `grid-file-upload.spec.ts`: clicks Add line before it looks for the
row's Receipt `input[type=file]`. The "materialise the ghost row"
comment is reworded.
- `grid-parent-rules.spec.ts`: clicks Add line before it fills Qty and
observes the `parent.status == 'paid'` lock.
- `grid-conditional-rules.spec.ts`: clicks Add line, fills Qty 2, then
tries a save (`md-form-submit`, refused because the header is empty). A
CONTROL then asserts that the line's always-required empty Product reads
red, so the flags are live and the next absence check is a real verdict.
The per-row `requiredWhen` checks are unchanged: Description is not
flagged at qty 2, is flagged at qty 100, and clears once filled.
## Tests
<details><summary>CLI e2e: red on main, green on the branch</summary>
`OS_TEST_TIERS=nightly pnpm --filter @objectstack/cli exec vitest run
--maxWorkers=2 test/lint-strict-warnings.e2e.test.ts`
On main (`141a826f` file):
```
FAIL |integration| test/lint-strict-warnings.e2e.test.ts > ... > a clean stack exits 0 under --strict, in both faces
AssertionError: the control is vacuous unless the stack is really clean: expected 1 to be +0
Tests 1 failed | 7 passed (8)
```
On the branch:
```
Test Files 1 passed (1)
Tests 8 passed (8)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Showcase live tier: red on main, green on the
branch</summary>
Run the way the nightly shard runs it: build the showcase dependency
closure, `pnpm console:build`, then `OS_TEST_TIERS=nightly pnpm --filter
@objectstack/example-showcase test` (`showcase-smoke.live.test.ts`
spawns `playwright test` against a real `serve --dev` backend). One
difference from CI: Chromium is the preinstalled
`/opt/pw-browsers/chromium` via `OS_TEST_CHROMIUM_EXECUTABLE_PATH`, not
`playwright install --with-deps`.
On main (`141a826f` spec, `playwright test e2e/detail-shapes.spec.ts`,
CI=1):
```
✘ [chromium] › e2e/detail-shapes.spec.ts:95:5 › grouped: fieldGroup sections render and Money starts collapsed (retry #1)
✓ [chromium] › e2e/detail-shapes.spec.ts:146:5 › stageField:false: status renders as a plain field, no stepper
✘ [chromium] › e2e/detail-shapes.spec.ts:161:5 › ungrouped + related-heavy: flat details and the related panels on Contoso (retry #1)
Locator: locator('[aria-label="Record path"]').first()
2 failed
1 passed
```
On the branch (`391fd92c`), the nightly command:
```
✓ 2 [chromium] › e2e/detail-shapes.spec.ts:101:5 › grouped: fieldGroup sections render and Money starts collapsed (4.7s)
✓ 3 [chromium] › e2e/detail-shapes.spec.ts:151:5 › stageField:false: status renders as a plain field, no stage tag (4.1s)
✓ 4 [chromium] › e2e/detail-shapes.spec.ts:169:5 › related-heavy: body tables, the tab row and the rail on Contoso (6.2s)
56 passed (3.1m)
```
</details>
<details><summary>Console live specs: red on main, green on the
branch</summary>
The four specs were run alone against a stand built the way
`console-live-specs.live.test.ts` builds one:
`ui/e2e/live/ci/start-backend.sh` on :4517, the Console built with
`VITE_BASE_PATH=/`, and `vite preview` on :5517.
On main (`141a826f` specs):
```
✘ 1 [chromium] › e2e/live/form-view-subforms.spec.ts:19:1 › New <object> modal renders relationship-derived subforms and submits an atomic batch
✘ 2 [chromium] › e2e/live/grid-conditional-rules.spec.ts:14:1 › a line cell flags required per row from a row-scoped requiredWhen
✘ 3 [chromium] › e2e/live/grid-file-upload.spec.ts:35:1 › inline line-item grid uploads a per-row file and persists it in the batch
✘ 4 [chromium] › e2e/live/grid-parent-rules.spec.ts:18:1 › a line locks when the header status becomes "paid" and unlocks when it changes back
4 failed
```
With Add line only, `grid-conditional-rules` still failed at
`line-items-invalid-0-description` (the new line waits for a save try).
The other three passed. After the save-try step, all four pass.
</details>
<details><summary>Final head: all three suites, the nightly
way</summary>
At `ae632881`. `OS_TEST_TIERS=nightly pnpm --filter
@objectstack/example-showcase test` runs both live files,
`showcase-smoke` and `console-live-specs`:
```
56 passed (2.6m) ← showcase-smoke.live.test.ts (Playwright, e2e/)
28 passed (1.7m) ← console-live-specs.live.test.ts (ui test:e2e:live:nightly)
Test Files 2 passed (2)
Tests 2 passed (2)
os-verify-lock: VERDICT command-exit 0
```
`OS_TEST_TIERS=nightly pnpm --filter @objectstack/cli exec vitest run
--maxWorkers=2 test/lint-strict-warnings.e2e.test.ts`:
```
Test Files 1 passed (1)
Tests 8 passed (8)
os-verify-lock: VERDICT command-exit 0
```
</details>
Typecheck: `pnpm --filter @objectstack/example-showcase typecheck &&
pnpm --filter @objectstack/cli typecheck` exits 0 (both tsconfigs
include the edited files: the showcase `e2e/**/*`, the CLI
`tsconfig.test.json` through `check:test-typecheck`). `pnpm --dir ui run
type-check:e2e` (`tsconfig.e2e.json`, which covers `ui/e2e/**`) also
exits 0.
## Acceptance notes
- Cause evidence for the four Console specs: the failing page's own
snapshot (the empty-grid hint row plus the `Add line` button), the
`GridField` change in ec24363, and the fact that the specs pass once
they add their line. I did not bisect by rebuilding the Console at
ec24363^, because the direct evidence already says which change and
which assumption.
- No changeset: no edited file ships (`@objectstack/cli` `files` is
`dist`, README, CHANGELOG; the showcase is private; `ui/e2e/**` belongs
to no package), so this PR takes the `skip-changeset` label.
## Verification
Read first: the `related-heavy` hunk of `detail-shapes.spec.ts` (the
largest rewrite, where the three dropped checks were), then the save-try
step and its Product CONTROL in
`ui/e2e/live/grid-conditional-rules.spec.ts`, then the `stack()` fixture
in `lint-strict-warnings.e2e.test.ts`.
Two-minute check: `OS_TEST_TIERS=nightly pnpm --filter @objectstack/cli
exec vitest run test/lint-strict-warnings.e2e.test.ts` should print
`Tests 8 passed (8)`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgW85kwjGaz7HqsmEuv -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments