-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: speed up CI a bit (hopefully) #9731
Changes from 14 commits
e42e772
3f9af22
45c3265
17b49d0
1f91498
74ed328
b7055ff
f263559
5839dea
ce404e8
5eddbb3
8189425
1505e77
8973f30
614f2dd
3249355
11868fb
5da35a9
5a58cd3
93e5933
6965313
b6b4075
c14b83f
62f75c2
622ceb3
69ecfc2
e440bb6
b437da5
a8ad7dc
72a71ef
6c5128c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { json } from '@sveltejs/kit'; | ||
import { increment } from '../state.js'; | ||
|
||
export function GET() { | ||
increment(); | ||
export function GET({ cookies }) { | ||
cookies.set('cache-control-bust-count', +(cookies.get('cache-control-bust-count') ?? 0) + 1 + ''); | ||
|
||
return json({}); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { json } from '@sveltejs/kit'; | ||
import { increment } from '../state.js'; | ||
|
||
export function GET() { | ||
increment(); | ||
export function GET({ cookies }) { | ||
cookies.set( | ||
'cache-control-default-count', | ||
+(cookies.get('cache-control-default-count') ?? 0) + 1 + '' | ||
); | ||
|
||
return json({}); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { json } from '@sveltejs/kit'; | ||
import { increment } from '../state.js'; | ||
|
||
export function GET() { | ||
increment(); | ||
export function GET({ cookies }) { | ||
cookies.set( | ||
'cache-control-force-count', | ||
+(cookies.get('cache-control-force-count') ?? 0) + 1 + '' | ||
); | ||
|
||
return json({}); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,10 @@ test.describe('a11y', () => { | |
}) | ||
).toBe(1); | ||
|
||
await clicknav('[href="/selection/b"]'); | ||
await clicknav('[href="/selection/b"]', { | ||
waitUntil: 'networkidle' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC, this was failing in safari when I had turned off tracing because the evaluation was happening before the text was selected/deselected |
||
}); | ||
|
||
expect( | ||
await page.evaluate(() => { | ||
const selection = getSelection(); | ||
|
@@ -98,16 +101,21 @@ test.describe('a11y', () => { | |
}); | ||
|
||
test('autofocus from previous page is ignored', async ({ page, clicknav }) => { | ||
page.addInitScript(` | ||
await page.addInitScript(` | ||
window.active = null; | ||
window.addEventListener('focusin', () => window.active = document.activeElement); | ||
`); | ||
|
||
await page.goto('/accessibility/autofocus/a'); | ||
await clicknav('[href="/"]'); | ||
|
||
expect(await page.evaluate(() => (window.active || {}).nodeName)).toBe('BODY'); | ||
expect(await page.evaluate(() => (document.activeElement || {}).nodeName)).toBe('BODY'); | ||
expect( | ||
await page.evaluate( | ||
// @ts-expect-error | ||
() => window.active?.nodeName | ||
) | ||
).toBe('BODY'); | ||
expect(await page.evaluate(() => document.activeElement?.nodeName)).toBe('BODY'); | ||
}); | ||
}); | ||
|
||
|
@@ -302,13 +310,12 @@ test.describe('Scrolling', () => { | |
await page.locator('#scroll-anchor').click(); | ||
const originalScrollY = /** @type {number} */ (await page.evaluate(() => scrollY)); | ||
await clicknav('#routing-page'); | ||
await page.goBack(); | ||
await page.waitForLoadState('networkidle'); | ||
await page.goBack({ waitUntil: 'networkidle' }); | ||
|
||
expect(page.url()).toBe(baseURL + '/anchor#last-anchor-2'); | ||
expect(await page.evaluate(() => scrollY)).toEqual(originalScrollY); | ||
|
||
await page.goBack(); | ||
await page.waitForLoadState('networkidle'); | ||
await page.goBack({ waitUntil: 'networkidle' }); | ||
|
||
expect(page.url()).toBe(baseURL + '/anchor'); | ||
expect(await page.evaluate(() => scrollY)).toEqual(0); | ||
|
@@ -507,7 +514,9 @@ test.describe.serial('Errors', () => { | |
|
||
test.describe('Prefetching', () => { | ||
test('prefetches programmatically', async ({ baseURL, page, app }) => { | ||
await page.goto('/routing/a'); | ||
await page.goto('/routing/a', { | ||
waitUntil: 'networkidle' | ||
}); | ||
|
||
/** @type {string[]} */ | ||
let requests = []; | ||
|
@@ -632,8 +641,9 @@ test.describe('Routing', () => { | |
await page.locator('[href="#hash-target"]').click(); | ||
await clicknav('[href="/routing/hashes/b"]'); | ||
|
||
await expect(page.locator('h1')).toHaveText('b'); | ||
await page.goBack(); | ||
expect(await page.textContent('h1')).toBe('a'); | ||
await expect(page.locator('h1')).toHaveText('a'); | ||
}); | ||
|
||
test('replaces state if the data-sveltekit-replacestate router option is specified for the hash link', async ({ | ||
|
@@ -684,7 +694,9 @@ test.describe('Routing', () => { | |
}); | ||
|
||
test('responds to <form method="GET"> submission without reload', async ({ page }) => { | ||
await page.goto('/routing/form-get'); | ||
await page.goto('/routing/form-get', { | ||
waitUntil: 'networkidle' | ||
}); | ||
expect(await page.textContent('h1')).toBe('...'); | ||
expect(await page.textContent('h2')).toBe('enter'); | ||
expect(await page.textContent('h3')).toBe('...'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -738,21 +738,16 @@ test.describe('Routing', () => { | |
await page.goto('/routing'); | ||
await clicknav('[href="/routing/a"]'); | ||
|
||
await page.goBack(); | ||
await page.waitForLoadState('networkidle'); | ||
await page.goBack({ waitUntil: 'networkidle' }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't we override |
||
expect(await page.textContent('h1')).toBe('Great success!'); | ||
}); | ||
|
||
test('focus works if page load has hash', async ({ page, browserName }) => { | ||
await page.goto('/routing/hashes/target#p2'); | ||
await page.goto('/routing/hashes/target#p2', { waitUntil: 'networkidle' }); | ||
|
||
await page.keyboard.press(browserName === 'webkit' ? 'Alt+Tab' : 'Tab'); | ||
await page.waitForTimeout(50); // give browser a bit of time to complete the native behavior of the key press | ||
expect( | ||
await page.evaluate( | ||
() => document.activeElement?.textContent || 'ERROR: document.activeElement not set' | ||
) | ||
).toBe('next focus element'); | ||
|
||
await page.waitForSelector('button:focus'); | ||
}); | ||
|
||
test('focus works when navigating to a hash on the same page', async ({ page, browserName }) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
state_counter
would be a better name?