diff --git a/src/libs/E2E/client.ts b/src/libs/E2E/client.ts index 7a0259de7eef..3088f280038c 100644 --- a/src/libs/E2E/client.ts +++ b/src/libs/E2E/client.ts @@ -23,8 +23,14 @@ const defaultRequestInit: RequestInit = { headers: defaultHeaders, }; -const sendRequest = (url: string, data: Record): Promise => - fetch(url, { +const sendRequest = (url: string, data: Record): Promise => { + // Don't process these specific API commands because running them over and over again in the tests hammers the server in a bad way. + if (url.includes('command=OptInToPushNotifications') || url.includes('command=OptOutOfPushNotifications')) { + console.debug('Skipping request to opt in or out of push notifications'); + return Promise.resolve(new Response()); + } + + return fetch(url, { method: 'POST', headers: { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -46,6 +52,7 @@ const sendRequest = (url: string, data: Record): Promise