diff --git a/package-lock.json b/package-lock.json index 14509eca038..6b60e97cfb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,7 +77,7 @@ "mermaid": "^12.0.0", "mitt": "^3.0.1", "path-normalize": "^8.0.0", - "prosemirror-markdown": "^1.13.7", + "prosemirror-markdown": "^1.13.8", "proxy-polyfill": "^0.3.2", "slug": "^12.0.1", "tippy.js": "^6.3.7", @@ -16576,9 +16576,9 @@ } }, "node_modules/prosemirror-markdown": { - "version": "1.13.7", - "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.7.tgz", - "integrity": "sha512-NV57Oxe3fXR+bNGXS5XW4sKt/XGIyY3n0eHVUoJORcismeF4FFMpLBnl0YESy2BvJQHloexX+9P+zT3VqFj/CQ==", + "version": "1.13.8", + "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.8.tgz", + "integrity": "sha512-Zi43BXX28jmxDJKvk8TDS2gMkBY/mgP8ynd6l/Vxrv8rgNFs5hsV1G0VscxTID1UCzVPcidADP9fUOBY3xxUeA==", "license": "MIT", "dependencies": { "@types/markdown-it": "^14.0.0", diff --git a/package.json b/package.json index a62dadd2eb3..b828b1c09c4 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "mermaid": "^12.0.0", "mitt": "^3.0.1", "path-normalize": "^8.0.0", - "prosemirror-markdown": "^1.13.7", + "prosemirror-markdown": "^1.13.8", "proxy-polyfill": "^0.3.2", "slug": "^12.0.1", "tippy.js": "^6.3.7", diff --git a/playwright/e2e/conflict.spec.ts b/playwright/e2e/conflict.spec.ts index ec54956829d..678bf17cc91 100644 --- a/playwright/e2e/conflict.spec.ts +++ b/playwright/e2e/conflict.spec.ts @@ -161,31 +161,35 @@ test.describe('Plaintext conflict resolution', () => { }) }) -test('[conflict] automatic resolution if no unsaved changes', async ({ - container, - editor, - file, - reader, - user, -}) => { - await expect(editor.el).toBeVisible() - await editor.typeHeading('Hello world') - // Wait for the steps to be pushed so the editor knows about unsaved changes - await expect(editor.saveIndicator).toHaveAccessibleName(/Unsaved changes/) - await editor.saveIndicator.click() - // Wait until client has successfully saved - await expect(editor.saveIndicator).not.toHaveAccessibleName(/Unsaved changes/) +test.describe('without unsaved changes', () => { + // Files were created 10 seconds ago so the server accepts the first autosave. + test.use({ mtime: Date.now() / 1000 - 10 }) - await user.uploadFile({ name: file.name, content: '## Good bye' }) + test('[conflict] automatic resolution if no unsaved changes', async ({ + container, + editor, + file, + reader, + user, + }) => { + await expect(editor.el).toBeVisible() + await editor.typeHeading('Hello world') + // Wait for the steps to be pushed so the editor knows about unsaved changes + await expect(editor.saveIndicator).toHaveAccessibleName(/Unsaved changes/) + // Autosave is debounced until all pushed steps are acknowledged. + await expect(editor.saveIndicator).not.toHaveAccessibleName(/Unsaved changes/) - // Should show latest content, no conflict dialog - await expect(editor.getHeading({ name: 'Good bye' })).toBeVisible({ - timeout: 10_000, + await user.uploadFile({ name: file.name, content: '## Good bye' }) + + // Should show latest content, no conflict dialog + await expect(editor.getHeading({ name: 'Good bye' })).toBeVisible({ + timeout: 10_000, + }) + await expect(reader.content).not.toBeVisible() + await expect(container.getButton({ + name: /Keep my local changes and overwrite the remote version/, + })).not.toBeVisible() }) - await expect(reader.content).not.toBeVisible() - await expect(container.getButton({ - name: /Keep my local changes and overwrite the remote version/, - })).not.toBeVisible() }) test('readonly session hides conflict dialog', async ({