diff --git a/frontend/cypress/e2e/task/task.spec.ts b/frontend/cypress/e2e/task/task.spec.ts index 2335b45d3..49abc9a2b 100644 --- a/frontend/cypress/e2e/task/task.spec.ts +++ b/frontend/cypress/e2e/task/task.spec.ts @@ -951,6 +951,43 @@ describe('Task', () => { .should('have.length', 5) cy.get('.task-view .checklist-summary') .should('contain.text', '2 of 5 tasks') + }) + + it('Persists checked checklist items after reload', () => { + const tasks = TaskFactory.create(1, { + id: 1, + description: ` +`, + }) + cy.visit(`/tasks/${tasks[0].id}`) + + cy.get('.task-view .checklist-summary') + .should('contain.text', '0 of 2 tasks') + cy.get('.tiptap__editor ul > li input[type=checkbox]') + .first() + .click() + + cy.get('.task-view .details.content.description h3 span.is-small.has-text-success') + .contains('Saved!') + .should('exist') + + cy.get('.task-view .checklist-summary') + .should('contain.text', '1 of 2 tasks') + + cy.reload() + + cy.get('.task-view .checklist-summary') + .should('contain.text', '1 of 2 tasks') + cy.get('.tiptap__editor ul > li input[type=checkbox]') + .first() + .should('be.checked') }) it('Should use the editor to render description', () => { diff --git a/frontend/src/components/input/editor/TipTap.vue b/frontend/src/components/input/editor/TipTap.vue index cabd2f31f..89f77d39a 100644 --- a/frontend/src/components/input/editor/TipTap.vue +++ b/frontend/src/components/input/editor/TipTap.vue @@ -452,7 +452,7 @@ const extensions : Extensions = [ // https://github.com/ueberdosis/tiptap/issues/3676 editor.value!.state.doc.descendants((subnode, pos) => { - if (node.eq(subnode)) { + if (subnode === node) { const {tr} = editor.value!.state tr.setNodeMarkup(pos, undefined, { ...node.attrs,