v4.0.0.1
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user