@@ -32,6 +32,7 @@ describe('Open test.md in viewer', function() {
3232
3333 // Upload test files
3434 cy . uploadFile ( 'test.md' , 'text/markdown' )
35+ cy . uploadFile ( 'empty.md' , 'text/markdown' )
3536 } )
3637
3738 beforeEach ( function ( ) {
@@ -68,6 +69,30 @@ describe('Open test.md in viewer', function() {
6869 cy . screenshot ( )
6970 } )
7071
72+ it ( 'Open an empty file' , function ( ) {
73+ cy . openFile ( 'empty.md' )
74+
75+ cy . log ( 'Inspect viewer' )
76+ const viewer = cy . get ( '#viewer' )
77+ viewer . should ( 'be.visible' )
78+ . and ( 'have.class' , 'modal-mask' )
79+ . and ( 'not.have.class' , 'icon-loading' )
80+ viewer . get ( '.modal-title' ) . should ( 'contain' , 'empty.md' )
81+ viewer . get ( '.modal-header button.action-item__menutoggle' )
82+ . should ( 'be.visible' )
83+
84+ cy . log ( 'Inspect editor' )
85+ const editor = viewer . get ( '#editor .ProseMirror' )
86+ editor . should ( 'contain' , '' )
87+
88+ cy . log ( 'Inspect menubar' )
89+ const menubar = editor . get ( '.menubar .menubar-icons' )
90+ menubar . get ( '.icon-undo' ) . should ( 'be.visible' )
91+ menubar . get ( '.icon-bold' ) . should ( 'be.visible' )
92+
93+ cy . screenshot ( )
94+ } )
95+
7196 it ( 'Closes the editor' , function ( ) {
7297 cy . openFile ( 'test.md' )
7398 cy . get ( '#viewer .modal-header button.header-close' ) . click ( )
0 commit comments