@@ -5,6 +5,11 @@ import createEditor from './../../src/tests/createEditor.js'
55import EditableTable from './../../src/nodes/EditableTable.js'
66import Markdown , { createMarkdownSerializer } from './../../src/extensions/Markdown.js'
77
8+ import { initUserAndFiles , randHash } from '../utils/index.js'
9+
10+ const randUser = randHash ( )
11+ const fileName = 'empty.md'
12+
813describe ( 'ListItem extension integrated in the editor' , ( ) => {
914
1015 const editor = createEditor ( {
@@ -67,3 +72,40 @@ describe('ListItem extension integrated in the editor', () => {
6772 return serializer . serialize ( editor . state . doc )
6873 }
6974} )
75+
76+ describe ( 'table plugin' , ( ) => {
77+ before ( ( ) => {
78+ initUserAndFiles ( randUser )
79+ } )
80+
81+ beforeEach ( ( ) => {
82+ cy . login ( randUser , 'password' )
83+
84+ cy . isolateTest ( {
85+ sourceFile : fileName ,
86+ } )
87+
88+ return cy . openFile ( fileName , { force : true } )
89+ } )
90+
91+ it ( 'inserts and removes a table' , ( ) => {
92+ cy . getContent ( )
93+ . type ( 'Let\'s insert a Table' )
94+
95+ cy . getActionEntry ( 'table' ) . click ( )
96+
97+ cy . getContent ( )
98+ . type ( 'content' )
99+
100+ cy . getContent ( )
101+ . find ( 'table tr:first-child th:first-child' )
102+ . should ( 'contain' , 'content' )
103+
104+ cy . getContent ( )
105+ . find ( '[data-text-table-actions="settings"]' ) . click ( )
106+
107+ cy . get ( '[data-text-table-action="delete"]' ) . click ( )
108+ cy . getContent ( )
109+ . should ( 'not.contain' , 'content' )
110+ } )
111+ } )
0 commit comments