Feature/188 filter dimensions #189

Merged
bermudalamb merged 13 commits from feature/188-filter-dimensions into main 2026-08-25 16:25:22 -05:00
2 changed files with 27 additions and 0 deletions
Showing only changes of commit 8771deeaca - Show all commits
@@ -126,4 +126,16 @@ test.describe('Admin inventory filters', () => {
await expect(adminInventory.clearFiltersButton).toHaveCount(0);
await expect(adminInventory.filtersButton).toHaveText('Filters');
});
// #188: the tally is the number of chips, so three statuses count as three.
// It read Filters (1) before, because status was added to the count by hand
// as a single flag regardless of how many were selected.
test('counts each selected status in the tally', async ({ admin, adminInventory }) => {
await admin.goto();
await adminInventory.toggleStatus('Available');
await adminInventory.toggleStatus('Reserved');
await adminInventory.toggleStatus('Sold');
await expect(adminInventory.filtersButton).toHaveText('Filters (3)');
});
});
+15
View File
@@ -232,4 +232,19 @@ test.describe('Storefront filters', () => {
await expect(wallArt.getByText(NAMES.vintage)).toBeVisible();
await expect(wallArt.getByText(NAMES.oak)).toBeVisible();
});
// #188: choosing anything but the default now shows a removable chip. This is
// what lets one predicate serve both the tally and the empty-state message —
// without it, a storefront filtered to Sold with no results would report
// itself as an empty shop rather than as a filter that matched nothing.
test('shows a removable chip for a non-default availability', async ({ storefront }) => {
await storefront.goto();
await expect(storefront.filterChip('Sold')).toHaveCount(0);
await storefront.chooseAvailability('Sold');
await expect(storefront.filterChip('Sold')).toBeVisible();
await storefront.removeFilterChip('Sold').click();
await expect(storefront.filterChip('Sold')).toHaveCount(0);
});
});