-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): add e2e test to check banner exists
- Loading branch information
Showing
1 changed file
with
31 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,31 @@ | ||
/* eslint-disable max-nested-callbacks */ | ||
import {expect, test} from '@playwright/test' | ||
|
||
import {createUniqueDocument, withDefaultClient} from '../../helpers' | ||
|
||
withDefaultClient((context) => { | ||
test.describe('sanity/structure: document pane', () => { | ||
test('on live edit document with a draft, a banner should appear', async ({page}) => { | ||
// create published document | ||
const uniqueDoc = await createUniqueDocument(context.client, {_type: 'playlist'}) | ||
const id = uniqueDoc._id! | ||
|
||
// create draft document | ||
await createUniqueDocument(context.client, { | ||
_type: 'playlist', | ||
_id: `drafts.${id}`, | ||
name: 'Edited by e2e test runner', | ||
}) | ||
|
||
await page.goto(`/test/content/playlist;${id}`) | ||
|
||
await expect(page.getByTestId('document-panel-scroller')).toBeAttached() | ||
await expect(page.getByTestId('string-input')).toBeAttached() | ||
|
||
// checks that inputs are set to read only | ||
await expect(await page.getByTestId('string-input')).toHaveAttribute('readonly', '') | ||
// checks that the banner is visible | ||
await expect(page.getByTestId('live-edit-type-banner')).toBeVisible() | ||
}) | ||
}) | ||
}) |