Skip to content

Commit 723d289

Browse files
committed
test(e2e): place the overview strip through the highlights slot
The default record page draws no strip since #35891, so the tabs-and-rail geometry pin places the stage path and key fields the way an author does, in the highlights slot, and keeps its span and tab assertions. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgTcbvQNTSr6ij3TMW7
1 parent 7886ee0 commit 723d289

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

‎ui/e2e/record-tabs-rail-35595.spec.ts‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import { uiRoot } from '../scripts/ui-root.mjs';
1818
* at the 1184 px a 1440 window leaves draws every tab.
1919
* - On 概览 the stage path and the key fields are at the top across the
2020
* whole width — both columns; CONTROL, the details column beside the rail
21-
* is narrower than they are.
21+
* is narrower than they are. Since objectstack#35891 the default page
22+
* draws no strip, so the fixture places one in the `highlights` slot, as
23+
* an authored page does.
2224
* - The rail is the 概览 tab's: another tab open draws no rail and no
2325
* strip; CONTROL, back on 概览 both are drawn again.
2426
* - A rail card's title opens its tab; CONTROL, the 概览 tab returns.
@@ -168,7 +170,7 @@ import { I18nProvider } from ${JSON.stringify(I18N)};
168170
import { RelatedCountStore } from ${JSON.stringify(COUNT_STORE)};
169171
import { RecordPageColumns } from ${JSON.stringify(PAGE_COLUMNS)};
170172
import { buildDefaultPageColumns, recordPageTierFor } from ${JSON.stringify(SYNTH_COLUMNS)};
171-
import { buildDefaultPageSchema } from ${JSON.stringify(SYNTH_PAGE)};
173+
import { buildDefaultHighlights, buildDefaultPageSchema } from ${JSON.stringify(SYNTH_PAGE)};
172174
173175
const h = React.createElement;
174176
const c = window.__case;
@@ -196,16 +198,21 @@ const approvals = {
196198
requests: [{ id: 'req-1' }],
197199
pendingRequest: { id: 'req-1', step_label: '经理审批', pending_approvers: ['u2'], pending_approver_names: { u2: '王经理' } },
198200
};
199-
const page = buildDefaultPageSchema(
200-
{ name: 'account', label: '客户', enable: { files: true }, fields: { name: { type: 'text' }, phone: { type: 'phone' }, rating: { type: 'select' } } },
201-
{
202-
related: RELATED.map(([objectName, relationshipField, title]) => ({ objectName, relationshipField, title })),
203-
highlightFields: ['phone'],
204-
statusField: 'rating',
205-
stages: [{ value: 'cold', label: '冷' }, { value: 'warm', label: '温' }, { value: 'hot', label: '热' }],
206-
approvals: { count: 1, node: { approvals, currentUserId: 'u1' } },
207-
},
208-
);
201+
const ACCOUNT = { name: 'account', label: '客户', enable: { files: true }, fields: { name: { type: 'text' }, phone: { type: 'phone' }, rating: { type: 'select' } } };
202+
const STRIP = {
203+
highlightFields: ['phone'],
204+
statusField: 'rating',
205+
stages: [{ value: 'cold', label: '冷' }, { value: 'warm', label: '温' }, { value: 'hot', label: '热' }],
206+
};
207+
// Since objectstack#35891 the default page draws no strip; the stage path and
208+
// the key fields are placed the way an author places them, in the highlights
209+
// slot, and the columns lay that strip out as before.
210+
const page = buildDefaultPageSchema(ACCOUNT, {
211+
related: RELATED.map(([objectName, relationshipField, title]) => ({ objectName, relationshipField, title })),
212+
...STRIP,
213+
approvals: { count: 1, node: { approvals, currentUserId: 'u1' } },
214+
slots: { highlights: buildDefaultHighlights(ACCOUNT, STRIP) },
215+
});
209216
const columns = buildDefaultPageColumns(page);
210217
211218
function Host() {

0 commit comments

Comments
 (0)