Skip to content

Commit 23df5c7

Browse 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>
1 parent fe75349 commit 23df5c7

6 files changed

Lines changed: 114 additions & 76 deletions

File tree

‎examples/app-showcase/e2e/detail-shapes.spec.ts‎

Lines changed: 77 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,33 @@ import { test, expect } from '@playwright/test';
55
* real-backend browser verification that closed objectui#2546 (PR4: legacy
66
* monolith detail renderer + `renderViaSchema` kill-switch removed).
77
*
8-
* Four shapes, one invariant each, all through the single SchemaRenderer /
9-
* `buildDefaultPageSchema` path the console now has:
10-
* - grouped → fieldGroup sections render; `collapse: 'collapsed'`
11-
* actually collapses (Money hides `budget` until opened)
12-
* - ungrouped → flat details body, no section cards
13-
* - stageField:false → NO `record:path` stepper despite a `status` field
14-
* named to bait the heuristic
8+
* Three shapes, all through the single SchemaRenderer /
9+
* `buildDefaultPageSchema` path the console now has. The default record page
10+
* draws no stage bar (`record:path`) and no key-field strip
11+
* (`record:highlights`) — objectstack#35891 — so every case asserts both
12+
* absent: the stage is the status tag beside the record's name, and
13+
* `highlightFields` leaves every field in its group.
14+
* - grouped → fieldGroup sections render, highlighted members
15+
* included; `collapse: 'collapsed'` actually collapses
16+
* (Money hides `amount` and `budget` until opened); the
17+
* header's stage tag reads `stageField: 'status'`
18+
* - stageField:false → NO stage tag despite a `status` field named to bait
19+
* the heuristic
1520
* - related-heavy → related lists surface by prominence (ADR-0085), in the
1621
* one-column stack tier (objectstack#27524): a
1722
* `relatedList: 'primary'` list is a body table in the
18-
* details (objectstack#27055, Target 8), the rest are
19-
* panels of the right column below them and read their
20-
* rows when they come into view
23+
* details (objectstack#27055, Target 8) and takes no tab;
24+
* the rest are tabs of the tab row (objectstack#35595),
25+
* and one with records is a card of the 概览 tab's rail
26+
* below the details (objectstack#35596)
2127
*
2228
* Runs against the console the backend serves at /_console (baseURL from
2329
* playwright.config.ts; storageState carries the admin session). The
2430
* semantic-zoo fixtures are objects but not seeded records — each run
2531
* creates its own rows via the REST API.
2632
*
27-
* Assertions are scoped to what the *pinned* console build supports
28-
* (.objectui-sha). The fb35e48 bump brought in objectui#2577, so the grouped
29-
* case also pins the follow-up UX contract: highlight strip drops the record
30-
* title, group icon/description render, and currencyConfig money shows its
31-
* symbol.
33+
* The grouped case also pins objectui#2577's UX contract: group
34+
* icon/description render, and currencyConfig money shows its symbol.
3235
*/
3336

3437
// Ambient `process` for the env reads below — the showcase tsconfig doesn't pull
@@ -44,6 +47,9 @@ const recordUrl = (object: string, id: string) =>
4447
`/_console/apps/${APP}/${object}/record/${encodeURIComponent(id)}`;
4548

4649
const PATH_STEPPER = '[aria-label="Record path"]';
50+
const HIGHLIGHT_STRIP = 'section[aria-label="Record highlights"]';
51+
/** The header's stage tag, plain or as its menu, carries the field it reads. */
52+
const stageTag = (field: string) => `[data-record-stage-tag="${field}"]:visible`;
4753

4854
let zooId = '';
4955
let zooLegacyId = '';
@@ -95,24 +101,20 @@ async function openRecord(page: import('@playwright/test').Page, url: string) {
95101
test('grouped: fieldGroup sections render and Money starts collapsed', async ({ page }) => {
96102
const errors = await openRecord(page, recordUrl('showcase_semantic_zoo', zooId));
97103

98-
// Stepper from stageField: 'status'.
99-
// record:path renders a desktop + a mobile variant — assert the visible one.
100-
await expect(page.locator(PATH_STEPPER).first()).toBeVisible();
101-
102-
// objectui#2577: the record title is the page H1 — it must NOT repeat as a
103-
// (truncated) chip in the highlight strip; status/amount still do.
104-
const strip = page.locator('section[aria-label="Record highlights"]');
105-
await expect(strip).toBeVisible();
106-
const stripText = (await strip.innerText()).replace(/\s+/g, ' ');
107-
expect(stripText, 'strip repeats the record title').not.toContain('E2E Zoo');
108-
expect(stripText).toContain('4,200');
109-
110-
// Declared groups render as titled sections. Their highlighted members
111-
// (status/amount) are hoisted to the strip; the non-highlighted members
112-
// (code/budget) keep the groups visible in the body.
113-
await expect(page.getByText('Basics', { exact: true })).toBeVisible();
114-
await expect(page.getByText('Money', { exact: true })).toBeVisible();
115-
await expect(page.getByText('ZG-1')).toBeVisible();
104+
// objectstack#35891: no stage bar and no key-field strip. The stage
105+
// (stageField: 'status') is the header's tag beside the record's name.
106+
await expect(page.locator(PATH_STEPPER)).toHaveCount(0);
107+
await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0);
108+
await expect(page.locator(stageTag('status')).first()).toHaveText(/Active/);
109+
110+
// Declared groups render as titled sections, every member in its own
111+
// group: the highlighted ones (status in Basics, amount in Money) are not
112+
// taken out of them.
113+
const details = page.locator('[data-record-column="details"]');
114+
await expect(details.getByText('Basics', { exact: true })).toBeVisible();
115+
await expect(details.getByText('Money', { exact: true })).toBeVisible();
116+
await expect(details.getByText('ZG-1')).toBeVisible();
117+
await expect(details.getByText('Status', { exact: true })).toBeVisible();
116118

117119
// objectui#2577: fieldGroups[].icon renders as a real (Lucide svg) icon in
118120
// the section header — not as literal icon-name text.
@@ -130,10 +132,13 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({
130132
).toBeVisible();
131133
await expect(page.getByText('banknote', { exact: true })).toHaveCount(0);
132134

133-
// collapse: 'collapsed' — Budget stays hidden until the header is opened.
134-
await expect(page.getByText('Budget', { exact: true })).toHaveCount(0);
135+
// collapse: 'collapsed' — Amount and Budget stay hidden until the header is
136+
// opened; then both are in the Money group.
137+
await expect(details.getByText('Budget', { exact: true })).toHaveCount(0);
138+
await expect(details.getByText('4,200')).toHaveCount(0);
135139
await page.getByText('Money', { exact: true }).click();
136-
await expect(page.getByText('Budget', { exact: true })).toBeVisible();
140+
await expect(details.getByText('Budget', { exact: true })).toBeVisible();
141+
await expect(details.getByText('4,200')).toBeVisible();
137142
// objectui#2577: fieldGroups[].description renders under the expanded
138143
// header, and the fixed-mode currencyConfig.defaultCurrency (USD) drives a
139144
// real $ symbol.
@@ -143,30 +148,33 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({
143148
expect(errors, 'uncaught page errors on grouped detail').toEqual([]);
144149
});
145150

146-
test('stageField:false: status renders as a plain field, no stepper', async ({ page }) => {
151+
test('stageField:false: status renders as a plain field, no stage tag', async ({ page }) => {
147152
const errors = await openRecord(
148153
page,
149154
recordUrl('showcase_semantic_zoo_legacy', zooLegacyId),
150155
);
151156

152157
// The whole point of `stageField: false`: the status-named select must NOT
153-
// become a chevron path. (objectui#2168 pinned strict-false handling.)
158+
// become the header's stage tag. (objectui#2168 pinned strict-false
159+
// handling.) No stage bar or strip either, as on every default page.
160+
await expect(page.locator('[data-record-stage-tag]')).toHaveCount(0);
154161
await expect(page.locator(PATH_STEPPER)).toHaveCount(0);
162+
await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0);
155163
// …but the field itself still renders (as a value, not a lifecycle).
156164
await expect(page.getByText('Green').first()).toBeVisible();
157165

158166
expect(errors, 'uncaught page errors on stageField:false detail').toEqual([]);
159167
});
160168

161-
test('ungrouped + related-heavy: flat details and the related panels on Contoso', async ({ page }) => {
169+
test('related-heavy: body tables, the tab row and the rail on Contoso', async ({ page }) => {
162170
// The synthesized record page lays itself out by the width of the view it
163171
// occupies, by one rule (objectstack#26678, objectstack#27524): details |
164172
// the right column from `RECORD_PAGE_TWO_COLUMN_MIN_WIDTH` (760 px,
165173
// `@object-ui/plugin-detail`), and ONE column below it — the details, then
166-
// the right column's panels in their order. No tier draws a tab strip. The
167-
// case stays in that stack tier on purpose: the column tiers are what every
168-
// other page of this smoke draws at the Desktop Chrome viewport, and the
169-
// stack is also what the split pane (720 px) and a phone draw.
174+
// the 概览 tab's rail. The tab row (objectstack#35595) is drawn in every
175+
// tier. The case stays in that stack tier on purpose: the column tiers are
176+
// what every other page of this smoke draws at the Desktop Chrome viewport,
177+
// and the stack is also what the split pane (720 px) and a phone draw.
170178
//
171179
// The window and the sidebar are derived, not picked. A collapsed console
172180
// sidebar draws no icon rail from 768 px up — ruling 6973617688 on
@@ -195,21 +203,27 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso'
195203
await page.getByTestId('sidebar-keep-open').click();
196204
await expect(page.getByTestId('sidebar-keep-open')).toHaveAttribute('aria-pressed', 'true');
197205

198-
// Heuristic stepper (account.status is a select named "status").
199-
// record:path renders a desktop + a mobile variant — assert the visible one.
200-
await expect(page.locator(PATH_STEPPER).first()).toBeVisible();
206+
// objectstack#35891: no stage bar, no key-field strip; the heuristic stage
207+
// (account.status is a select named "status") is the header's tag.
208+
await expect(page.locator(PATH_STEPPER)).toHaveCount(0);
209+
await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0);
210+
await expect(page.locator(stageTag('status')).first()).toBeVisible();
201211

202-
// One column and no tab strip: the details, then the right column.
212+
// One column: the details, then the rail. The tab row opens on 概览.
203213
await expect(page.locator('[data-record-page-tier]')).toHaveAttribute('data-record-page-tier', 'stack');
204214
await expect(page.locator('[data-record-columns]')).toHaveAttribute('data-record-columns-shown', 'details');
205-
await expect(page.getByRole('tab', { name: /Details|Related|Invoices|Projects/i })).toHaveCount(0);
215+
await expect(page.locator('[data-record-tab="overview"]')).toHaveAttribute('aria-selected', 'true');
206216

207217
// Related lists surface by prominence (ADR-0085), as record page v3 draws
208218
// them (objectstack#27055, Target 8): Invoices and Projects are
209219
// `relatedList: 'primary'` (CORE relationships), so each is a body table in
210-
// the details, with its rows read at open; the rest of Contoso's lists
211-
// (Contacts and the Field Zoo lookups) are panels of the right column,
212-
// before its last panel, 动态 (objectstack#34590).
220+
// the details, with its rows read at open, and takes no tab of its own; the
221+
// rest of Contoso's lists (Contacts and the Field Zoo lookups) are tabs, and
222+
// one with records is a card of the rail (objectstack#35596).
223+
// CONTROL for the absence below: an ordinary list's tab is drawn under the
224+
// same `OBJECT.FIELD` id, so a renamed id scheme reds here, not silently.
225+
await expect(page.locator('[data-record-tab="showcase_contact.account"]')).toHaveCount(1);
226+
await expect(page.locator('[data-record-tab^="showcase_invoice."], [data-record-tab^="showcase_project."]')).toHaveCount(0);
213227
const details = page.locator('[data-record-column="details"]');
214228
const invoicesTable = details
215229
.getByRole('table')
@@ -220,29 +234,27 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso'
220234
await expect(invoicesTable.getByRole('cell', { name: 'INV-1002', exact: true })).toBeVisible();
221235
await expect(projectsTable.getByRole('cell', { name: 'Data Platform', exact: true })).toBeVisible();
222236
const rightColumn = page.locator('[data-record-column="right"]');
223-
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
224-
await expect(rightColumn.locator(':scope > *').last()).toHaveAttribute('data-record-timeline-panel', '');
225237
await expect(rightColumn.getByRole('region', { name: /^(Invoices|Projects)$/ })).toHaveCount(0);
226238

227-
// Ungrouped shape: the details body is flat — no fieldGroup section cards.
228-
// (Contoso declares no fieldGroups; spot-check a body field label.)
229-
await expect(page.getByText('Basics', { exact: true })).toHaveCount(0);
239+
// Contoso's own groups render in the details (ADR-0085 §5), its highlighted
240+
// fields among their members.
241+
await expect(details.getByText('Profile', { exact: true })).toBeVisible();
230242

231-
// objectui#2577 + currencyConfig: annual revenue renders with its symbol
232-
// in the strip, and the meta footer doesn't dangle "Created by" on the
233-
// actor-less seeded row.
234-
await expect(page.getByText('$25,000,000', { exact: false }).first()).toBeVisible();
243+
// objectui#2577 + currencyConfig: annual revenue (a highlighted field, left
244+
// in its Profile group) renders with its symbol in the details, and the
245+
// meta footer doesn't dangle "Created by" on the actor-less seeded row.
246+
await expect(details.getByText('$25,000,000', { exact: false }).first()).toBeVisible();
235247
const footer = page.locator('[data-testid="record-meta-footer"]');
236248
await expect(footer).toBeVisible();
237249
const footerText = (await footer.innerText()).replace(/\s+/g, ' ');
238250
expect(footerText, 'footer dangles "Created by" without an actor').not.toMatch(/Created by/);
239251
expect(footerText).toMatch(/Created/);
240252

241-
// A panel reads its rows once it is in view: below the details here, so
242-
// the Contacts panel reads Contoso's seeded contacts when scrolled to.
243-
const contactsPanel = rightColumn.getByRole('region', { name: 'Contacts', exact: true });
244-
await contactsPanel.scrollIntoViewIfNeeded();
245-
await expect(contactsPanel.locator('[data-related-card-row]').filter({ hasText: 'Carl Fox' })).toBeVisible();
253+
// The rail's Contacts card summarizes the Contacts tab: its first rows,
254+
// Contoso's seeded contacts among them.
255+
const contactsCard = rightColumn.getByRole('region', { name: 'Contacts', exact: true });
256+
await contactsCard.scrollIntoViewIfNeeded();
257+
await expect(contactsCard.locator('[data-record-summary-row]').filter({ hasText: 'Carl Fox' })).toBeVisible();
246258

247259
expect(errors, 'uncaught page errors on related-heavy detail').toEqual([]);
248260
});

‎packages/cli/test/lint-strict-warnings.e2e.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ function expectVerdictKeys(run: Run, payload: Record<string, unknown>, label: st
125125
/**
126126
* One shape, four knobs. `engines` absent is one warning (`protocol/missing-
127127
* engines-range`); a master_detail without `required` is a second; omitting
128-
* its `deleteBehavior` / `inlineEdit` is two suggestions; an unknown list-view
129-
* column is an error. Each fixture below turns the knobs it needs and no other.
128+
* its `deleteBehavior` and the parent field group that places the line items
129+
* (`relatedList`; the FK's `inlineEdit` only picks the form factor) is two
130+
* suggestions; an unknown list-view column is an error. Each fixture below
131+
* turns the knobs it needs and no other.
130132
*/
131133
function stack(
132134
ns: string,
@@ -135,6 +137,7 @@ function stack(
135137
const { engines = true, requireMaster = true, adviseMaster = true, unknownColumn = false } = opts;
136138
const enginesLine = engines ? `engines: { protocol: '>=1' },` : '';
137139
const masterAdvice = adviseMaster ? `deleteBehavior: 'cascade', inlineEdit: true,` : '';
140+
const lineGroup = adviseMaster ? `fieldGroups: [{ key: 'lines', label: 'Lines', relatedList: '${ns}_line' }],` : '';
138141
const masterRequired = requireMaster ? `required: true,` : '';
139142
const columns = unknownColumn ? `'title', 'nope_missing'` : `'title'`;
140143
return `
@@ -147,6 +150,7 @@ export default {
147150
sharingModel: 'private',
148151
fields: { title: { type: 'text', label: 'Title' } },
149152
listViews: { all: { label: 'All', columns: [${columns}] } },
153+
${lineGroup}
150154
},
151155
{
152156
name: '${ns}_line',

‎ui/e2e/live/form-view-subforms.spec.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from '@playwright/test';
2-
import { selectOption, fillLookup } from './helpers';
2+
import { addLineItem, selectOption, fillLookup } from './helpers';
33

44
/**
55
* Tier 0 live e2e: an object's standard New/Edit modal renders inline child
@@ -10,7 +10,8 @@ import { selectOption, fillLookup } from './helpers';
1010
* lines in one atomic /api/v1/batch.
1111
*
1212
* This exercises the full modern grid:
13-
* • the trailing "ghost" row — type straight into it, no "Add line" click;
13+
* • "Add line" appends an editable row (the grid draws no blank entry row,
14+
* objectstack#35507), and only the line that carries data is submitted;
1415
* • a Product catalog typeahead whose selection auto-fills the line's
1516
* description + unit_price (matching field names);
1617
* • the computed read-only `amount = quantity × unit_price`, recomputed live
@@ -39,9 +40,10 @@ test('New <object> modal renders relationship-derived subforms and submits an at
3940
await selectOption(page, 'status', 'draft');
4041
await expect(dialog.getByText('Northwind', { exact: false }).first()).toBeVisible();
4142

42-
// Pick a catalog product in the ghost row — its description + unit_price
43-
// auto-fill, and the row materialises (no "Add line" click).
43+
// "Add line", then pick a catalog product on the new row — its description
44+
// + unit_price auto-fill.
4445
const li = dialog.getByTestId('line-items');
46+
await addLineItem(page);
4547
await li.getByTestId('lookup-trigger').first().click();
4648
const option = page.getByRole('option', { name: /Widget A/i }).first();
4749
await option.waitFor({ state: 'visible' });
@@ -79,6 +81,6 @@ test('New <object> modal renders relationship-derived subforms and submits an at
7981
expect(Number(child?.data?.unit_price)).toBe(29.99); // auto-filled
8082
expect(Number(child?.data?.amount)).toBe(59.98); // computed (2 × 29.99)
8183
expect(Number(child?.data?.position)).toBe(0); // sort position stamped from row order
82-
// The empty ghost line must NOT have been persisted as a blank child.
84+
// Exactly the one line that was added and filled is persisted.
8385
expect(ops.filter((o: any) => o.object === 'showcase_invoice_line')).toHaveLength(1);
8486
});

‎ui/e2e/live/grid-conditional-rules.spec.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { test, expect } from '@playwright/test';
2+
import { addLineItem } from './helpers';
23

34
/**
45
* B2 in grids (A1): an inline line-item cell honors its column's `requiredWhen`
@@ -18,12 +19,23 @@ test('a line cell flags required per row from a row-scoped requiredWhen', async
1819
const dialog = page.getByRole('dialog');
1920
await expect(dialog.getByTestId('md-form-submit')).toBeVisible();
2021

22+
// The grid draws no blank entry row (objectstack#35507): a new invoice's
23+
// grid is empty until "Add line" appends the row this case drives.
2124
const grid = dialog.getByTestId('line-items');
25+
await addLineItem(page);
2226
const qty = grid.locator('input[aria-label="Qty"]').first();
2327
await expect(qty).toBeVisible();
2428

25-
// Below threshold: a small qty leaves Description optional (no invalid flag).
29+
// A line Add just appended reads no required cell red until a save of the
30+
// form is tried (objectstack#35816, objectstack#35940), so try one: the
31+
// header is empty, so it is refused, and from then on the line's verdicts
32+
// are drawn. CONTROL: the line's always-required, still empty Product now
33+
// reads red — the flags are live, so the absence below is a verdict.
2634
await qty.fill('2');
35+
await dialog.getByTestId('md-form-submit').click();
36+
await expect(grid.getByTestId('line-items-invalid-0-product')).toBeVisible();
37+
38+
// Below threshold: a small qty leaves Description optional (no invalid flag).
2739
await expect(grid.getByTestId('line-items-invalid-0-description')).toHaveCount(0);
2840

2941
// Cross the threshold: quantity >= 100 ⇒ Description (still empty) flags

0 commit comments

Comments
 (0)