Skip to content

Commit

Permalink
test(e2e): update reference tests for corel (#8314)
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias authored Jan 17, 2025
1 parent 86ecfa7 commit 4b2d6c8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/e2e/tests/inputs/reference.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ withDefaultClient((context) => {

// Open the Author reference input.
await referenceInput.getByLabel('Open').click()
await expect(authorListbox).toBeAttached()
await expect(authorListbox).toBeVisible()

// Select the first document in the list.
Expand All @@ -52,7 +51,6 @@ withDefaultClient((context) => {
await page.locator('#author-menuButton').click()
await page.getByRole('menuitem').getByText('Replace').click()
await referenceInput.getByLabel('Open').click()
await expect(authorListbox).toBeAttached()
await expect(authorListbox).toBeVisible()

// Select the next document in the list.
Expand All @@ -69,19 +67,23 @@ withDefaultClient((context) => {
page,
createDraftDocument,
}) => {
test.slow()
const originalTitle = 'Initial Doc'

await createDraftDocument('/test/content/input-standard;referenceTest')
page.getByTestId('string-input').fill(originalTitle)

await expect(
page.getByTestId('create-new-document-select-aliasRef-selectTypeMenuButton'),
).toBeVisible()
/** create reference */
await page.getByTestId('create-new-document-select-aliasRef-selectTypeMenuButton').click()

// Wait for the new document referenced to be created & loaded
await expect(page.getByTestId('document-panel-document-title').nth(1)).toContainText('Untitled')

// switch to original doc
page.getByRole('button', {name: originalTitle}).click()
page.getByText('PublishedDraft').first().click()

// open the context menu
page.getByTestId('pane-context-menu-button').first().click()
Expand Down Expand Up @@ -125,7 +127,7 @@ withDefaultClient((context) => {
await expect(documentStatus.nth(1)).toContainText('Published just now')

/** --- IN ORIGINAL DOC --- */
page.getByRole('button', {name: originalTitle}).click()
page.getByText('PublishedDraft').first().click()

page.getByTestId('action-publish').first().click() // publish reference

Expand Down Expand Up @@ -153,7 +155,8 @@ withDefaultClient((context) => {
const documentStatus = page.getByTestId('pane-footer-document-status')

await createDraftDocument('/test/content/input-debug;simpleReferences')
page.getByTestId('string-input').fill(originalTitle)
await expect(page.getByTestId('string-input')).toBeVisible()
await page.getByTestId('string-input').fill(originalTitle)

/** create reference */
await expect(
Expand All @@ -173,7 +176,7 @@ withDefaultClient((context) => {
await expect(documentStatus.nth(1)).toContainText('Published just now')

/** --- IN ORIGINAL DOC --- */
page.getByRole('button', {name: originalTitle}).click()
page.getByText('PublishedDraft').first().click()

page.getByTestId('action-publish').first().click() // publish reference

Expand Down

0 comments on commit 4b2d6c8

Please sign in to comment.