From 59d2ac3b4eca748ba1d1e2557a554c22659ac25f Mon Sep 17 00:00:00 2001 From: pedrobonamin Date: Thu, 28 Nov 2024 14:47:26 +0100 Subject: [PATCH] fix(tests): update live edit test --- .../header/perspective/DocumentPerspectiveList.tsx | 2 +- test/e2e/tests/document-actions/liveEdit.spec.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx b/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx index eabf1f31c9e..1dbb9c7c51e 100644 --- a/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx +++ b/packages/sanity/src/structure/panes/document/documentPanel/header/perspective/DocumentPerspectiveList.tsx @@ -114,7 +114,7 @@ export const DocumentPerspectiveList = memo(function DocumentPerspectiveList() { )} } - disabled={!editState?.published} + disabled={editState?.liveEdit ? false : !editState?.published} onClick={handleBundleChange('published')} selected={ /** the publish is selected when: diff --git a/test/e2e/tests/document-actions/liveEdit.spec.ts b/test/e2e/tests/document-actions/liveEdit.spec.ts index 0323a714a1a..3c746e934cb 100644 --- a/test/e2e/tests/document-actions/liveEdit.spec.ts +++ b/test/e2e/tests/document-actions/liveEdit.spec.ts @@ -8,6 +8,9 @@ test(`liveEdited document can be created, edited, and deleted`, async ({ const name = 'Test Name' await createDraftDocument('/test/content/playlist') + await page.getByText('select the publish document to edit it') + // Navigate to the published perspective + await page.getByRole('button', {name: 'Published'}).click() await page.getByTestId('field-name').getByTestId('string-input').fill(name) await page.getByTestId('action-menu-button').click()