Skip to content

Commit

Permalink
test(integration): cover being asked to log in when requesting a review
Browse files Browse the repository at this point in the history
Adds a spec making sure that the log-in dialog appears when trying to request a review.

I've not gone further for the moment as it requires integration with an external system (ORCID).

Ref #388
  • Loading branch information
thewilkybarkid committed Aug 4, 2021
1 parent 453b948 commit 0a7ae8f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions integration/src/requesting-a-review.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { test, expect } from '@playwright/test';
import { blur } from './utils';

test.describe('requesting a review', () => {
test('have to log in with ORCID', async ({ page }) => {
await page.goto('/reviews');
await page.route(/https?:\/\/(?:.+\.)?twitter.com(?:$|\/|\?|#)/, route =>
route.abort(),
);
await page.click(':text("Get started")');

await page.click(':text("Add Request")');

const dialog = await page.waitForSelector('[role="dialog"]');
await dialog.scrollIntoViewIfNeeded();

expect(await dialog.innerText()).toContain('You must be logged in');

const screenshot = await page.screenshot().then(blur);

expect(screenshot).toMatchSnapshot('log-in.png');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0a7ae8f

Please sign in to comment.