Skip to content

Commit 76c3810

Browse files
xuyushun441-sysos-zhuangclaude
authored
test(e2e): lookup quick-filter coverage (CRM parity) (#1682)
Covers the record-picker dropdown path: the Task List view's project filter (master-detail lookup) opens a searchable record list, picking a record narrows the grid and persists as uf_project. This is the capability hotcrm's account workbench (owner: user lookup) depends on. Skips gracefully when the running showcase metadata predates the project lookup filter example (framework companion PR). Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent bfe412a commit 76c3810

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

e2e/live/user-filters.spec.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,43 @@ test.describe('ADR-0047 interface mode — Task Workbench', () => {
103103
await expect(page.getByTestId('record-count-bar')).toContainText(/^2 /, { timeout: 15000 });
104104
});
105105
});
106+
107+
test.describe('ADR-0047 lookup quick filter (CRM parity)', () => {
108+
// The Task List view exposes `project` (a master-detail lookup) as a
109+
// quick filter — the record-picker dropdown path hotcrm's account
110+
// workbench (owner: user lookup) depends on. Requires the showcase
111+
// metadata from framework feat/adr-0047-lookup-filter-example or later.
112+
test('lookup field renders a record picker and filters by reference', async ({ page }) => {
113+
await page.goto('/apps/showcase_app/showcase_task/view/showcase_task.tabular');
114+
115+
// Wait for the filter bar to render before probing for the overflow.
116+
await expect(page.getByTestId('filter-badge-status')).toBeVisible({ timeout: 15000 });
117+
118+
const projectBadge = page.getByTestId('filter-badge-project');
119+
// maxVisible folds the 4th field into the "More" overflow when present.
120+
if (!(await projectBadge.isVisible().catch(() => false))) {
121+
const more = page.getByTestId('user-filters').getByRole('button', { name: /More|/ });
122+
if (!(await more.isVisible().catch(() => false))) {
123+
test.skip(true, 'showcase metadata without the project lookup filter — skipping');
124+
}
125+
await more.click();
126+
}
127+
await projectBadge.click();
128+
129+
// The lookup picker renders with a search box and record options.
130+
const picker = page.getByTestId('filter-lookup-project');
131+
await expect(picker).toBeVisible();
132+
// The picker is a trigger button that opens the record search list;
133+
// records render as multi-select checkboxes.
134+
await picker.getByRole('button', { name: /Search|/ }).click();
135+
const option = page.getByRole('checkbox', { name: 'Website Relaunch' });
136+
await expect(option).toBeVisible();
137+
138+
// Picking a record narrows the list and persists as a uf_* param.
139+
await option.click();
140+
await expect(page).toHaveURL(/uf_project=/);
141+
await expect(page.getByTestId('record-count-bar')).toContainText(/\d+/, { timeout: 15000 });
142+
// The badge reflects one active selection.
143+
await expect(page.getByTestId('filter-badge-project')).toContainText('1');
144+
});
145+
});

0 commit comments

Comments
 (0)