Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions examples/app-showcase/e2e/bulk-capability-gate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,23 @@ test('selection bar hides capability-gated inline defs from a caller without the
await selectAll.waitFor({ state: 'visible', timeout: 25_000 });
await selectAll.click();

// The bar offers the ungated defs…
// The bar offers the ungated defs: it draws the first two as buttons and
// the rest behind its "⋮" (`SELECTION_EXPOSED_ACTIONS`, ui plugin-grid
// `SelectionPageBar.tsx`, citing #35554 「露出一到两个,其余进⋮」), where a
// def is a `row-context-bulk-NAME` menu item instead of a
// `bulk-action-NAME` button. All four ungated defs are read, so none of
// them can drop out of the bar unnoticed.
await expect(page.getByTestId('bulk-action-set_labels')).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId('bulk-action-assign_team')).toBeVisible();
await expect(page.getByTestId('bulk-action-reassign_account')).toBeVisible();
await expect(page.getByTestId('bulk-action-reschedule')).toBeVisible();
await page.getByTestId('selection-actions-more').click();
await expect(page.getByTestId('row-context-bulk-reassign_account')).toBeVisible();
await expect(page.getByTestId('row-context-bulk-reschedule')).toBeVisible();

// …and neither gated def — the ungated assertions above are what make these
// two absences evidence of the GATE, not of a bar that failed to render.
await expect(page.getByTestId('bulk-action-relabel_ops')).toHaveCount(0);
await expect(page.getByTestId('bulk-action-purge_restricted')).toHaveCount(0);
// …and neither gated def, as a button or as an item of the open "⋮" — the
// ungated assertions above are what make these absences evidence of the
// GATE, not of a bar or a menu that failed to render.
for (const gated of ['relabel_ops', 'purge_restricted']) {
await expect(page.getByTestId(`bulk-action-${gated}`)).toHaveCount(0);
await expect(page.getByTestId(`row-context-bulk-${gated}`)).toHaveCount(0);
}
});
13 changes: 9 additions & 4 deletions packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,11 @@ describe('run-dev.js on a workspace package with no build output', () => {
// The upstream line is deliberately NOT suppressed: nothing here changes
// which arguments the CLI accepts or how oclif reports, only what is said
// alongside. Asserting it also proves case 1 really reached that failure
// rather than dying earlier for some unrelated reason.
expect(unbuilt.stderr).toContain('Error: command i18n:extract:nope.ts not found');
// rather than dying earlier for some unrelated reason. The id is spelled
// as typed, with the CLI's space topic separator: the `command_not_found`
// hook (`src/hooks/command-not-found/point-at-help.ts`) words the refusal
// that oclif still raises and prints.
expect(unbuilt.stderr).toContain('Error: command i18n extract nope.ts not found');
expect(unbuilt.code).toBe(2);
});

Expand Down Expand Up @@ -376,8 +379,10 @@ describe('the same probe, read by a parent that stalls (the merge-queue shape)',
// so it survives only because awaiting our own write had already emptied
// the buffer ahead of it. This assertion reds in the queue beside the lead
// line — and a formatter that had merely failed to LOAD could not have
// removed it, which is what rules that reading out.
expect(stalled.stderr).toContain('Error: command i18n:extract:nope.ts not found');
// removed it, which is what rules that reading out. (The words are the
// `command_not_found` hook's, the id spelled as typed; the write and the
// exit on top of ours are still oclif's `handle()`.)
expect(stalled.stderr).toContain('Error: command i18n extract nope.ts not found');
expect(stalled.code).toBe(2);
});
});
Expand Down
15 changes: 14 additions & 1 deletion ui/e2e/live/inline-edit-polish-2572.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ test('record inline-edit polish (#2572) — showcase Project end-to-end', async
'an unlocked approval step reads "In approval · editable"',
).toBeVisible({ timeout: 30_000 });
await expect(page.getByText('Locked for approval')).toHaveCount(0);
// The band's text alone no longer tells the two steps apart: once the
// header draws the approval tag, the band draws no lock badge on the locked
// step either (#35593 item 4, band → tag). The tag is what does — it names
// the pending request here without carrying the lock, the control for the
// locked reading below, which is the same tag with
// `data-record-approval-locked`.
const approvalTag = page.getByTestId('record-approval-tag');
await expect(approvalTag, 'the header names the pending approval').toBeVisible();
await expect(approvalTag, 'an unlocked approval step does not lock the tag').not.toHaveAttribute('data-record-approval-locked');
// A double-click on the budget still opens an inline-edit session.
await budgetGroupOnPage().locator(`[title="${EDIT_HINT}"]`).dblclick();
await expect(saveBtn, 'inline editing stays live during an unlocked approval').toBeVisible();
Expand Down Expand Up @@ -246,7 +255,11 @@ test('record inline-edit polish (#2572) — showcase Project end-to-end', async
{ timeout: 60_000, intervals: [2_000] },
)
.toBe(0);
await expect(page.getByText('Locked for approval').first()).toBeVisible();
// The lock reaches the reader through the record header's approval tag,
// which carries it (its title says why editing is locked); the band draws
// no second 'Locked for approval' badge beside it.
await expect(approvalTag, 'the header names the locking approval').toBeVisible();
await expect(approvalTag, 'the approval tag carries the lock').toHaveAttribute('data-record-approval-locked', '');

// …and a double-click on the (former) budget field must NOT open a session.
await budgetGroupOnPage().dblclick();
Expand Down
43 changes: 34 additions & 9 deletions ui/e2e/live/record-history-display.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,58 @@ test('the timeline stream\'s Changes chip shows display values (localized dates,
await changesChip.waitFor({ state: 'visible', timeout: 15_000 });
await changesChip.click();
await expect(changesChip).toHaveAttribute('aria-pressed', 'true');
// The three UPDATE entries are consecutive field changes by one person on
// one day, so the stream folds them into ONE collapsed row
// (`foldStreamChanges`, plugin-detail `RecordActivityTimeline.tsx`;
// #35602). Pin that grouping, then expand it: the reads below are of the
// change lines themselves, never of the fold's summary.
const fold = stream.getByTestId('activity-fold');
await expect(fold, 'the updates are one fold row').toHaveCount(1, { timeout: 15_000 });
const expand = fold.locator('button[aria-expanded]');
await expect(expand, 'the fold starts collapsed').toHaveAttribute('aria-expanded', 'false');
await expand.click();
await expect(expand).toHaveAttribute('aria-expanded', 'true');
const foldEntries = fold.getByTestId('activity-fold-entries');
// The three UPDATE entries render as change lines; wait for the latest one.
await expect(stream.locator('[data-stream-change]', { hasText: 'Owner' }).first()).toBeVisible({ timeout: 15_000 });
await expect(foldEntries.locator('[data-stream-change]', { hasText: 'Owner' }).first()).toBeVisible({ timeout: 15_000 });
// The fold counts the rows it expands to, and holds all three updates. (The
// Changes chip also draws the creation's own audit entry as a change line,
// which folds in beside them when it is stamped the same day, so the count
// is not pinned to exactly three.)
const foldRow = foldEntries.locator('[data-stream-row]');
await expect(foldRow.filter({ hasText: 'Customer Since', hasNotText: 'Lifecycle' }), 'the date update').toHaveCount(1);
await expect(foldRow.filter({ hasText: 'Finance' }), 'the lifecycle and industry update').toHaveCount(1);
await expect(foldRow.filter({ hasText: other.name }), 'the owner update').toHaveCount(1);
await expect(fold).toHaveAttribute('data-fold-count', String(await foldRow.count()));
const text = (await stream.innerText()).replace(/\s+/g, ' ');
// What the change lines say, without the fold row's summary (which names
// fields, not values): every positive read below is of a real line, and
// every absence is read over the whole stream.
const lines = (await foldEntries.innerText()).replace(/\s+/g, ' ');

// 3) Actor attribution: the audit user resolves to a display name —
// never the raw id, never the unknown-user fallback (`detail.unknownUser`).
expect(text).toContain(actor.name);
expect(lines).toContain(actor.name);
expect(text).not.toContain(actor.id);
expect(text).not.toMatch(/\bUnknown\b|未知用户/);

// 4) Select values render as option labels, not raw stored values.
expect(text).toMatch(/Prospect/);
expect(text).toMatch(/Active/);
expect(text).toMatch(/Technology/);
expect(text).toMatch(/Finance/);
expect(lines).toMatch(/Prospect/);
expect(lines).toMatch(/Active/);
expect(lines).toMatch(/Technology/);
expect(lines).toMatch(/Finance/);
expect(text).not.toMatch(/\bprospect\b|\bactive\b|\btechnology\b|\bfinance\b/);

// 5) Dates are localized — no raw ISO payloads anywhere, neither a datetime
// nor the stored YYYY-MM-DD of the date field. The date's diff line is
// there to read, so the absence below is not vacuous.
expect(text).toMatch(/Customer Since/);
expect(lines).toMatch(/Customer Since/);
expect(text).not.toMatch(/T\d{2}:\d{2}:\d{2}\.\d{3}Z/);
expect(text).not.toMatch(/\b\d{4}-\d{2}-\d{2}\b/);

// 6) The owner lookup resolves to the users' names on the diff line, never
// to their ids.
expect(text).toMatch(/Owner/);
expect(text).toContain(other.name);
expect(lines).toMatch(/Owner/);
expect(lines).toContain(other.name);
expect(text).not.toContain(other.id);
});
Loading