From 469a2ffc24e5ca29391a2a9bd747611c6f848827 Mon Sep 17 00:00:00 2001 From: Ryan Kegel Date: Thu, 26 Mar 2026 12:51:29 -0400 Subject: [PATCH] refactor: simplify array initialization in child sort order tests --- .../notification-click-scroll.spec.ts | 14 ++++++-------- .../task-sorting/child-sort-order.spec.ts | 16 ++-------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/frontend/vue-app/e2e/mode_parent/notifications/notification-click-scroll.spec.ts b/frontend/vue-app/e2e/mode_parent/notifications/notification-click-scroll.spec.ts index afe79ab..d881ea1 100644 --- a/frontend/vue-app/e2e/mode_parent/notifications/notification-click-scroll.spec.ts +++ b/frontend/vue-app/e2e/mode_parent/notifications/notification-click-scroll.spec.ts @@ -135,10 +135,9 @@ test.describe('Notification click navigates and scrolls to task', () => { await notifItem.click() // Verify navigation to parent child view with scrollTo query param - await page.waitForURL( - new RegExp(`/parent/${childId}\\?scrollTo=.*&entityType=chore`), - { timeout: 5000 }, - ) + await page.waitForURL(new RegExp(`/parent/${childId}\\?scrollTo=.*&entityType=chore`), { + timeout: 5000, + }) // Verify the target chore card is scrolled into viewport const targetCard = choreSection(page).locator('.item-card').filter({ hasText: targetChoreName }) @@ -156,10 +155,9 @@ test.describe('Notification click navigates and scrolls to task', () => { await notifItem.click() - await page.waitForURL( - new RegExp(`/parent/${childId}\\?scrollTo=.*&entityType=reward`), - { timeout: 5000 }, - ) + await page.waitForURL(new RegExp(`/parent/${childId}\\?scrollTo=.*&entityType=reward`), { + timeout: 5000, + }) const targetCard = rewardSection(page).locator('.item-card').filter({ hasText: REWARD_NAME }) await expect(targetCard).toBeVisible({ timeout: 5000 }) diff --git a/frontend/vue-app/e2e/mode_parent/task-sorting/child-sort-order.spec.ts b/frontend/vue-app/e2e/mode_parent/task-sorting/child-sort-order.spec.ts index d5c1e6d..453edd3 100644 --- a/frontend/vue-app/e2e/mode_parent/task-sorting/child-sort-order.spec.ts +++ b/frontend/vue-app/e2e/mode_parent/task-sorting/child-sort-order.spec.ts @@ -109,13 +109,7 @@ test.describe('Child mode sort order', () => { cheapRewardId = await createReward(request, CHEAP_REWARD, 15) expensiveRewardId = await createReward(request, EXPENSIVE_REWARD, 100) - const allChoreIds = [ - schedEarlyId, - schedLateId, - generalChoreId, - pendingChoreId, - nonTodayChoreId, - ] + const allChoreIds = [schedEarlyId, schedLateId, generalChoreId, pendingChoreId, nonTodayChoreId] await request.put(`/api/child/${childId}/set-tasks`, { data: { task_ids: allChoreIds, type: 'chore' }, }) @@ -174,13 +168,7 @@ test.describe('Child mode sort order', () => { test.afterAll(async ({ request }) => { if (childId) await request.delete(`/api/child/${childId}`) - for (const id of [ - schedEarlyId, - schedLateId, - generalChoreId, - pendingChoreId, - nonTodayChoreId, - ]) { + for (const id of [schedEarlyId, schedLateId, generalChoreId, pendingChoreId, nonTodayChoreId]) { if (id) await request.delete(`/api/task/${id}`) } for (const id of [pendingRewardId, cheapRewardId, expensiveRewardId]) {