-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(integration): cover being asked to log in when requesting a review
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
1 parent
453b948
commit 0a7ae8f
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
...ation/src/requesting-a-review.spec.ts-snapshots/log-in-Desktop-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
integration/src/requesting-a-review.spec.ts-snapshots/log-in-iPhone-11-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.