2
0
Files
bot/apps/viewer/playwright/services/browser.ts

13 lines
528 B
TypeScript
Raw Normal View History

2022-08-21 22:33:09 +02:00
import { Page } from '@playwright/test'
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,
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()
})