diff --git a/cypress/e2e/Table.spec.js b/cypress/e2e/Table.spec.js index fcf62355161..554214c9388 100644 --- a/cypress/e2e/Table.spec.js +++ b/cypress/e2e/Table.spec.js @@ -5,6 +5,11 @@ import createEditor from './../../src/tests/createEditor.js' import EditableTable from './../../src/nodes/EditableTable.js' import Markdown, { createMarkdownSerializer } from './../../src/extensions/Markdown.js' +import { initUserAndFiles, randHash } from '../utils/index.js' + +const randUser = randHash() +const fileName = 'empty.md' + describe('ListItem extension integrated in the editor', () => { const editor = createEditor({ @@ -67,3 +72,40 @@ describe('ListItem extension integrated in the editor', () => { return serializer.serialize(editor.state.doc) } }) + +describe('table plugin', () => { + before(() => { + initUserAndFiles(randUser) + }) + + beforeEach(() => { + cy.login(randUser, 'password') + + cy.isolateTest({ + sourceFile: fileName, + }) + + return cy.openFile(fileName, { force: true }) + }) + + it('inserts and removes a table', () => { + cy.getContent() + .type('Let\'s insert a Table') + + cy.getActionEntry('table').click() + + cy.getContent() + .type('content') + + cy.getContent() + .find('table tr:first-child th:first-child') + .should('contain', 'content') + + cy.getContent() + .find('[data-text-table-actions="settings"]').click() + + cy.get('[data-text-table-action="delete"]').click() + cy.getContent() + .should('not.contain', 'content') + }) +}) diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 1766761f09b..57547f1b455 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -153,34 +153,6 @@ describe('Workspace', function() { .should('contain', 'Hello world') }) - it('inserts and removes a table', function() { - cy.openWorkspace() - .type('Let\'s insert a Table') - - cy.getMenu() - .then($el => { - // sometimes actions can be hide - if ($el.find('[data-text-action-entry="remain"]').length) { - toggleMoreActions() - return submenuButton('table').click() - } - - return menuButton('table').click() - }) - - cy.getContent() - .type('content') - cy.getContent() - .find('table tr:first-child th:first-child') - .should('contain', 'content') - cy.getContent() - .find('[data-text-table-actions="settings"]').click() - - cy.get('[data-text-table-action="delete"]').click() - cy.getContent() - .should('not.contain', 'content') - }) - it('emoji picker', () => { cy.openWorkspace() .type('# Let\'s smile together{enter}## ') @@ -323,10 +295,6 @@ const submenuButton = (name) => { return cy.get('.v-popper__wrapper .open').getActionEntry(name) } -const toggleMoreActions = () => { - return menuButton('remain').click() -} - const menuBubbleButton = (name) => { return cy.get('[data-text-el="menu-bubble"]').find(`[data-text-bubble-action="${name}"]`) }