Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
48 changes: 26 additions & 22 deletions playwright/e2e/conflict.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ({
Expand Down
Loading