Skip to content

Commit

Permalink
CI: add route list test
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Jul 27, 2023
1 parent 023f925 commit 011b506
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/__puppeteer__/routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,24 @@ describe('routing', () => {
});
});

it('load route list', async () => {
await page.goto(`http://localhost:${PORT}/4cf7a6ad03080c90`, { waitUntil: 'networkidle2' });
await sleep(2000);

// ".DriveList" should be visible
const driveList = await page.$('.DriveList');
expect(driveList).toBeTruthy();

// Page should have one ".DriveEntry" element
const driveEntries = await page.$$('.DriveEntry');
expect(driveEntries.length).toBe(1);
});

it('load route from URL', async () => {
await page.goto(`http://localhost:${PORT}/4cf7a6ad03080c90/1632948396703/1632949028503`, { waitUntil: 'networkidle2' });
await sleep(10000);

// Should load video with src
const video = await page.$('video');
expect(video).toBeTruthy();
const videoSrc = await page.evaluate((vid) => vid.getAttribute('src'), video);
Expand Down

0 comments on commit 011b506

Please sign in to comment.