Skip to content

Commit 131773a

Browse files
committed
wip(record-page): host tests follow the retired rail
Claude-Session: https://claude.ai/code/session_01L6bhgUZTwDqtEFzNFCVTri Co-authored-by: Claude <noreply@anthropic.com>
1 parent 44cbdac commit 131773a

10 files changed

Lines changed: 151 additions & 541 deletions

‎ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,13 @@ afterEach(() => {
173173
});
174174

175175
describe('objectui#12625 — the record page names its regions, header actions and section headers', () => {
176-
it('the right column and its cards are named by their labels; the 动态 tab by its label', async () => {
176+
it('the record\'s tabs are named by their labels: 详情, the related lists, 动态 (objectstack#35890: no right column)', async () => {
177177
await mountLeadPage();
178-
const right = screen.getByRole('complementary', { name: 'Right column' });
179-
expect(right).toBeInTheDocument();
180-
// objectstack#35595 / #35596 — the stream is the Activity tab; the rail's
181-
// cards are regions named by their titles.
178+
// objectstack#35890 — the right rail is retired: no complementary region.
179+
expect(screen.queryByRole('complementary', { name: 'Right column' })).toBeNull();
180+
expect(screen.getByRole('tab', { name: /^Details/ })).toBeInTheDocument();
182181
expect(screen.getByRole('tab', { name: /^Activity/ })).toBeInTheDocument();
183-
expect(await within(right).findByRole('region', { name: 'Task' })).toBeInTheDocument();
182+
expect(await screen.findByRole('tab', { name: /^Task/ })).toBeInTheDocument();
184183
});
185184

186185
it('the header actions are named by their labels', async () => {

‎ui/packages/app-shell/src/views/RecordDetailView.feedLoadFailure-29188.test.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ beforeEach(() => {
197197
});
198198
afterEach(() => { cleanup(); vi.unstubAllGlobals(); });
199199

200-
async function boot(answers: Answers = {}, search = '') {
200+
// objectstack#35890 — no rail draws a 最近动态 card any more: the stream is on
201+
// screen in its 动态 tab, so a page opens there unless a test says otherwise.
202+
async function boot(answers: Answers = {}, search = '?related=timeline') {
201203
const { fetch, held } = heldTransport(answers);
202204
vi.stubGlobal('fetch', fetch);
203205
const ds = new ObjectStackAdapter({ baseUrl: BASE, fetch, autoReconnect: false });
@@ -229,7 +231,8 @@ const ACTIVITY_FAILED = "We couldn't load the activity for this record.";
229231
const NO_COMMENTS = { comments: [], reactions: { records: [] } };
230232
const NO_ACTIVITY = { total: 0, records: [] };
231233

232-
const peekOf = (c: HTMLElement) => c.querySelector('[data-record-timeline-peek]') as HTMLElement;
234+
/** The stream as drawn: its 动态 tab (the rail's peek card retired, objectstack#35890). */
235+
const peekOf = (c: HTMLElement) => c.querySelector('[data-related-enlarged="timeline"]') as HTMLElement;
233236
/**
234237
* objectstack#35595 / #35596 — the stream's whole face is the 动态 tab
235238
* (`?related=timeline`). An empty stream draws no card on the 概览 rail, so
@@ -244,7 +247,7 @@ const retryButton = (c: HTMLElement) => c.querySelector('[data-feed-retry]') as
244247
const timelineTab = (c: HTMLElement) =>
245248
Array.from(c.querySelectorAll('[role="tab"]')).find((t) => /^Activity/.test(t.textContent ?? ''))?.textContent;
246249
/** Open the record over an adapter that reads every stream on its own. */
247-
async function bootDirect(answers: Answers, search = '') {
250+
async function bootDirect(answers: Answers, search = '?related=timeline') {
248251
const booted = await boot(answers, search);
249252
Object.assign(booted.ds, { getRecordPage: undefined, prefetchRecordPage: undefined });
250253
return booted;

‎ui/packages/app-shell/src/views/RecordDetailView.harness.test.tsx‎

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,16 +2145,14 @@ describe('RecordDetailView.bodyTablePredicate-27478', () => {
21452145
// ── RecordDetailView.relatedCountsFirst-27056 ───────────────────────────────
21462146

21472147
/**
2148-
* objectstack#27056, as objectstack#35595/#35596 lay the page out — the related
2149-
* lists load counts first and never block the details. Every list is a tab;
2150-
* the 概览 tab's right rail lists, under 「其他相关」, the lists that have
2151-
* records, with their first three rows. Measured:
2148+
* objectstack#27056, as objectstack#35890 lays the page out — the related
2149+
* lists load counts first and never block the details. Every list is a tab
2150+
* (the right rail that previewed their first rows is retired). Measured:
21522151
*
21532152
* - the details draw from the record read alone, while every related read is
21542153
* still out, with every list's tab drawn (no number yet) and no rail card;
21552154
* - the six counts go out as ONE request set, before any of them answers;
2156-
* - once they answer, rows are read for the lists counted above 0 only, three
2157-
* rows each — never for a list counted at 0.
2155+
* - once they answer, no list's rows are read while its tab is closed.
21582156
*/
21592157

21602158
describe('RecordDetailView.relatedCountsFirst-27056', () => {
@@ -2334,7 +2332,7 @@ describe('RecordDetailView.relatedCountsFirst-27056', () => {
23342332
expect(container.querySelector('[data-record-summary-other]')).toBeNull();
23352333
});
23362334

2337-
it('asks the six counts as one request set, then three rows of each list counted above 0 only', async () => {
2335+
it('asks the six counts as one request set, and no list\'s rows while its tab is closed (objectstack#35890: no rail)', async () => {
23382336
const { container } = renderPage();
23392337
await idle();
23402338
// One request set: every list's count, all out before any answered, and
@@ -2347,25 +2345,14 @@ describe('RecordDetailView.relatedCountsFirst-27056', () => {
23472345
for (const r of reads.filter((read) => !read.answered)) r.answer();
23482346
});
23492347
await idle();
2350-
const rowReads = reads.filter(isRowRead);
2351-
// Every list counted above 0; never the second, counted at 0.
2352-
const withRecords = CHILDREN.filter((c) => TOTALS[c] > 0);
2353-
expect(rowReads.map((r) => r.object).sort()).toEqual([...withRecords].sort());
2354-
for (const r of rowReads) expect(r.query.$top).toBe(3);
2355-
expect(reads.some((r) => r.object === C2 && isRowRead(r))).toBe(false);
2356-
2357-
await act(async () => {
2358-
for (const r of reads.filter((read) => !read.answered)) r.answer();
2359-
});
2360-
await idle();
2361-
const rail = column(container, 'right')!;
2362-
const rowsOf = (c: string) =>
2363-
rail.querySelector(`[data-record-summary-card="${c}.account"]`)?.querySelectorAll('[data-record-summary-row]') ?? [];
2364-
expect(rowsOf(C1)).toHaveLength(3);
2365-
expect(rowsOf(C3)).toHaveLength(2);
2366-
// CONTROL: the list counted at 0 has no rail card at all, but keeps its tab.
2367-
expect(rail.querySelector(`[data-record-summary-card="${C2}.account"]`)).toBeNull();
2348+
// objectstack#35890 — the rail that drew three rows of each list is
2349+
// retired: on 「详情」 no list's rows are read, counted above 0 or not.
2350+
expect(reads.filter(isRowRead)).toEqual([]);
2351+
expect(column(container, 'right')).toBeNull();
2352+
expect(container.querySelector('[data-record-summary-card]')).toBeNull();
2353+
// CONTROL: the list counted at 0 keeps its tab, marked empty.
23682354
expect(container.querySelector(`[data-record-tab="${C2}.account"]`)?.hasAttribute('data-record-tab-empty')).toBe(true);
2355+
expect(container.querySelector(`[data-record-tab="${C1}.account"]`)?.hasAttribute('data-record-tab-empty')).toBe(false);
23692356
});
23702357
});
23712358
});

0 commit comments

Comments
 (0)