From 4d24828c2f61cf2709a79089ab70c5bd93bff7cc Mon Sep 17 00:00:00 2001 From: pedrobonamin Date: Wed, 15 Jan 2025 11:12:40 +0100 Subject: [PATCH] fix(test): restore skipped tests --- .../document/document-pair/operations/publish.test.ts | 3 +-- .../document/document-pair/serverOperations/publish.test.ts | 3 +-- test/e2e/tests/document-actions/unpublish.spec.ts | 5 ++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/sanity/src/core/store/_legacy/document/document-pair/operations/publish.test.ts b/packages/sanity/src/core/store/_legacy/document/document-pair/operations/publish.test.ts index bbfa9e6bcdb..76a4a31b373 100644 --- a/packages/sanity/src/core/store/_legacy/document/document-pair/operations/publish.test.ts +++ b/packages/sanity/src/core/store/_legacy/document/document-pair/operations/publish.test.ts @@ -12,8 +12,7 @@ beforeEach(() => { ;(isLiveEditEnabled as Mock).mockClear() }) -// TODO: Restore this test -describe.skip('publish', () => { +describe('publish', () => { describe('disabled', () => { // kind of a useless test but preserves the order at least it('returns with LIVE_EDIT_ENABLED if isLiveEditEnabled', () => { diff --git a/packages/sanity/src/core/store/_legacy/document/document-pair/serverOperations/publish.test.ts b/packages/sanity/src/core/store/_legacy/document/document-pair/serverOperations/publish.test.ts index 5bfa2c981ef..74d6ea87754 100644 --- a/packages/sanity/src/core/store/_legacy/document/document-pair/serverOperations/publish.test.ts +++ b/packages/sanity/src/core/store/_legacy/document/document-pair/serverOperations/publish.test.ts @@ -12,8 +12,7 @@ beforeEach(() => { ;(isLiveEditEnabled as Mock).mockClear() }) -// TODO: Restore this test -describe.skip('publish', () => { +describe('publish', () => { describe('disabled', () => { it('returns with LIVE_EDIT_ENABLED if isLiveEditEnabled', () => { ;(isLiveEditEnabled as Mock).mockImplementation( diff --git a/test/e2e/tests/document-actions/unpublish.spec.ts b/test/e2e/tests/document-actions/unpublish.spec.ts index 400904e779f..d689b4f643c 100644 --- a/test/e2e/tests/document-actions/unpublish.spec.ts +++ b/test/e2e/tests/document-actions/unpublish.spec.ts @@ -34,5 +34,8 @@ test(`should be able to unpublish a published document`, async ({page, createDra await expect(unpublishModal).toBeVisible() await page.getByTestId('confirm-button').click() - await expect(documentStatus).toContainText('') + // Check the published button is disabled that is the reference to determine the published document doesn't exist. + const button = await page.getByRole('button', {name: 'Published'}) + await expect(button).toBeDisabled() + await expect(documentStatus).toContainText('Draft Edited just now') })