This commit is contained in:
2026-05-19 23:36:58 +12:00
parent 5172588488
commit a7f8a619b1
68 changed files with 4486 additions and 1430 deletions
+19 -3
View File
@@ -12,9 +12,16 @@ vi.mock('$lib/server/content', () => ({
import { load } from './+page.server';
function createLoadEvent(url = 'https://www.goodwalk.co.nz/') {
// The loader now also receives `cookies`; resolveSurface only touches it
// when ?preview is involved, which these tests don't exercise.
return {
url: new URL(url)
} as Parameters<typeof load>[0];
url: new URL(url),
cookies: {
get: () => undefined,
set: () => {},
delete: () => {}
}
} as unknown as Parameters<typeof load>[0];
}
describe('home page server load', () => {
@@ -27,7 +34,16 @@ describe('home page server load', () => {
});
});
it('returns the onboarding variant on the onboarding host', async () => {
it('returns the onboarding variant on the clients host', async () => {
getHomepageContent.mockResolvedValue(homepageContent);
await expect(load(createLoadEvent('https://clients.goodwalk.co.nz/'))).resolves.toEqual({
siteVariant: 'onboarding',
isPreview: false
});
});
it('still returns the onboarding variant on the legacy onboarding host', async () => {
getHomepageContent.mockResolvedValue(homepageContent);
await expect(load(createLoadEvent('https://onboarding.goodwalk.co.nz/'))).resolves.toEqual({