test(review): cover the card Tag button and raise the review floors

The card's Tag on Needs review now has a workflow, and the page's queue
change hook has no unused default. review.mjs and review-state.mjs
floors rise to their measured coverage; no other floor changes.
This commit is contained in:
Vito Sansevero
2026-10-22 19:48:00 -07:00
parent 8d0260acef
commit 305c7e1441
3 changed files with 15 additions and 9 deletions
+6
View File
@@ -195,6 +195,12 @@ test('tag image from review saves tags and the item remains pending', async ({ p
expect(await links(request)).toEqual(before);
const [item] = (await (await request.get('/prompt_manager/review/items')).json()).items;
expect([item.state, item.revision]).toEqual(['pending', 0]);
// The card's Tag opens the same dialog.
await cards(page).first().getByRole('button', { name: 'Tag or auto-tag review_0000.png', exact: true }).click();
await expect(dialog).toBeVisible();
await expect(dialog.locator('p.tag-scope-note')).toBeVisible();
await page.keyboard.press('Escape');
await expect(dialog).toHaveCount(0);
});
test('an empty queue shows the empty notice only', async ({ page, request }) => {
+7 -7
View File
@@ -390,16 +390,16 @@
"statements": 95
},
"workspace/review-state.mjs": {
"lines": 94,
"branches": 77,
"lines": 95,
"branches": 82,
"functions": 98,
"statements": 94
"statements": 95
},
"workspace/review.mjs": {
"lines": 96,
"branches": 84,
"functions": 90,
"statements": 96
"lines": 98,
"branches": 89,
"functions": 91,
"statements": 98
},
"workspace/saved-views.mjs": {
"lines": 98,
+2 -2
View File
@@ -63,7 +63,7 @@ export function imageOf(item) {
* a change elsewhere (the shell re-reads the Needs review count); `controller` and `connect` (the change stream's
* EventSource) are injectable for tests.
*/
export function mountReview(main, { api, scope, onDecision = () => {}, onQueueChange = () => {},
export function mountReview(main, { api, scope, onDecision = () => {}, onQueueChange,
connect = openEvents, controller = createReviewController({ api }) }) {
scope.cleanup(() => controller.dispose());
const heading = pageHeading(main);
@@ -256,7 +256,7 @@ export function mountReview(main, { api, scope, onDecision = () => {}, onQueueCh
const changed = () => {
if (scope.signal.aborted) return;
controller.refresh();
onQueueChange();
onQueueChange?.();
};
events.addEventListener('ready', changed);
events.addEventListener('change', changed);