Skip to content

Commit

Permalink
Fix tests and api in chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiber committed Aug 12, 2021
1 parent eb32fae commit 2814653
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/scripts/content/api/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ const request = async <T = any>(url: string, init?: RequestInit) => {
while (true) {
const auth = opt.auth ? { "Authorization": `Bearer ${opt.auth}` } : {};
const i = Object.assign({}, init, {
"credentials": "include",
"credentials": "omit",
"headers": {
"Accept": "application/json, text/plain, */*",
"Accept-Language": "en,en-US;q=0.5",
"Nebula-Platform": "web",
"Sec-GPC": "1",
...auth,
},
"mode": "cors"
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/content/api/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const refreshToken = async () => {
const apiAuth = apiToken ? { "Authorization": `Token ${apiToken}` } : {};

const req = await fetch("https://api.watchnebula.com/api/v1/authorization/", {
"credentials": "include",
"credentials": "omit",
"headers": {
"Accept": "application/json, text/plain, */*",
"Accept-Language": "en-US,en;q=0.5",
Expand Down
10 changes: 8 additions & 2 deletions tests/integration/queue.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { addToQueue, expectQueueLength, qbuttSelector, queueSelector, titles, videoSelector } from "../shared";

describe('videos page', () => {
jest.setTimeout(10000);
jest.setTimeout(10000);

beforeAll(async () => {
await page.goto(__NEBULA_BASE__);
await page.waitForSelector('.CookieConsent-Button');
await page.click('.CookieConsent-Button');
});

describe('videos page', () => {
beforeEach(async () => {
await page.goto(`${__NEBULA_BASE__}/videos`);
await page.waitForSelector(videoSelector);
Expand Down

0 comments on commit 2814653

Please sign in to comment.