2022-08-21 22:33:09 +02:00
|
|
|
import { Page } from '@playwright/test'
|
|
|
|
|
2022-09-24 08:58:23 +02:00
|
|
|
export const mockSessionResponsesToOtherUser = async (page: Page) =>
|
|
|
|
page.route('/api/auth/session', (route) => {
|
2022-08-21 22:33:09 +02:00
|
|
|
if (route.request().method() === 'GET') {
|
|
|
|
return route.fulfill({
|
|
|
|
status: 200,
|
2022-09-24 08:58:23 +02:00
|
|
|
body: '{"user":{"id":"otherUserId","name":"James Doe","email":"other-user@email.com","emailVerified":null,"image":"https://avatars.githubusercontent.com/u/16015833?v=4","stripeId":null,"graphNavigation": "TRACKPAD"}}',
|
2022-08-21 22:33:09 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
return route.continue()
|
|
|
|
})
|