describe ( 'Export' , ( ) => { const testTitle = 'testContent' ; const testContent = `---\ntitle: ${ testTitle }\n---\nThis is some test content` ; beforeEach ( ( ) => { cy . visitTestEditor ( ) ; cy . setCodemirrorContent ( testContent ) ; } ) ; it ( 'Markdown' , ( ) => { cy . getByCypressId ( 'menu-export' ) . click ( ) ; cy . getByCypressId ( 'menu-export-markdown' ) . click ( ) ; cy . get ( 'a[download]' ) . then ( ( anchor ) => new Cypress . Promise ( ( resolve , _ ) => { const xhr = new XMLHttpRequest ( ) ; xhr . open ( 'GET' , anchor . prop ( 'href' ) , true ) ; xhr . responseType = 'blob' ; xhr . onload = ( ) => { if ( xhr . status === 200 ) { const blob = xhr . response ; const reader = new FileReader ( ) ; reader . onload = ( ) => { resolve ( reader . result ) ; } ; reader . readAsText ( blob ) ; } } ; xhr . send ( ) ; } ) ) . should ( 'equal' , testContent ) ; } ) ; } ) ;