Skip to content

Commit 7d887c7

Browse files
ryan-williamsclaude
andcommitted
fix(tests): avoid Latest mode in forward navigation tests
Forward navigation tests were failing because navigating from position 21-40 back to position 1-20 triggered Latest mode (timestamp: null). Latest mode fetches data for NOW (Jan 2026), but test data ends in Nov 2025, resulting in 0 records and test timeouts. Fix: navigate backward 2 steps then forward 1, avoiding Latest mode while still testing the forward navigation functionality. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9bdbf77 commit 7d887c7

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

www/test/e2e/network-requests.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,20 @@ test.describe('Network Request Behavior', () => {
300300
})
301301

302302
test('table page forward (.) after backward does not fetch', async ({ page }) => {
303-
// Go back by table page
303+
// Go back by TWO table pages (avoid triggering Latest mode on forward)
304+
await page.keyboard.press(',')
305+
await waitForNetworkSettle(page)
304306
await page.keyboard.press(',')
305307
await waitForNetworkSettle(page)
306308

307309
clearRequests()
308310

309-
// Go forward by table page
311+
// Go forward by table page (returns to previous position, not Latest)
310312
await page.keyboard.press('.')
311313
await waitForNetworkSettle(page)
312314

313315
const gymRequests = getRequests(17617)
314-
// Should have NO fetches
316+
// Should have NO fetches (data was cached from initial + backward navigation)
315317
expect(gymRequests).toHaveLength(0)
316318
})
317319
})

www/test/e2e/table-pagination.spec.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,23 @@ test.describe('Table Pagination Navigation', () => {
131131
expect(tableText).toBe('21-40 of 254,859 × 1m')
132132
})
133133

134-
test('> button pans forward by one page (21-40 → 1-20)', async ({ page }) => {
135-
// First go back one page to 21-40
134+
test('> button pans forward by one page (41-60 → 21-40)', async ({ page }) => {
135+
// Go back TWO pages to 41-60 (avoid triggering Latest mode on forward)
136+
await page.locator('.pagination button[aria-label="Pan backward by one table page"]').click()
137+
await page.waitForTimeout(500)
136138
await page.locator('.pagination button[aria-label="Pan backward by one table page"]').click()
137139
await page.waitForTimeout(500)
138140

139141
let tableText = await page.locator('.pagination .page-info').textContent()
140-
expect(tableText).toBe('21-40 of 254,859 × 1m')
142+
expect(tableText).toBe('41-60 of 254,859 × 1m')
141143

142144
// Click > button (pan forward by one table page)
143145
await page.locator('.pagination button[aria-label="Pan forward by one table page"]').click()
144146
await page.waitForTimeout(500)
145147

146-
// Should return to 1-20 (Latest mode)
148+
// Should move forward to 21-40 (not Latest mode, since we started further back)
147149
tableText = await page.locator('.pagination .page-info').textContent()
148-
expect(tableText).toBe('1-20 of 254,859 × 1m')
150+
expect(tableText).toBe('21-40 of 254,859 × 1m')
149151
})
150152

151153
test('<< button pans backward by plot width', async ({ page }) => {
@@ -163,20 +165,22 @@ test.describe('Table Pagination Navigation', () => {
163165
})
164166

165167
test('>> button pans forward by plot width', async ({ page }) => {
166-
// First go back by plot width
168+
// Go back by TWO plot widths (avoid triggering Latest mode on forward)
169+
await page.locator('.pagination button[aria-label="Pan backward by one plot width"]').click()
170+
await page.waitForTimeout(500)
167171
await page.locator('.pagination button[aria-label="Pan backward by one plot width"]').click()
168172
await page.waitForTimeout(500)
169173

170174
const backText = await page.locator('.pagination .page-info').textContent()
171-
expect(backText).toBe('1,441-1,460 of 254,859 × 1m')
175+
expect(backText).toBe('2,881-2,900 of 254,859 × 1m')
172176

173177
// Click >> button (pan forward by plot width)
174178
await page.locator('.pagination button[aria-label="Pan forward by one plot width"]').click()
175179
await page.waitForTimeout(500)
176180

177-
// Should return to Latest mode (1-20)
181+
// Should move forward by one plot width to 1,441-1,460 (not Latest mode)
178182
const forwardText = await page.locator('.pagination .page-info').textContent()
179-
expect(forwardText).toBe('1-20 of 254,859 × 1m')
183+
expect(forwardText).toBe('1,441-1,460 of 254,859 × 1m')
180184
})
181185

182186
test('|< button jumps to earliest data', async ({ page }) => {

0 commit comments

Comments
 (0)