mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 19:53:59 -05:00
3db6bcf892
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
48 lines
1.7 KiB
TypeScript
48 lines
1.7 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
describe('Import markdown file', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/n/test')
|
|
cy.get('.btn.active.btn-outline-secondary > i.fa-columns')
|
|
.should('exist')
|
|
})
|
|
|
|
it('import on blank note', () => {
|
|
cy.get('button#editor-menu-import')
|
|
.click()
|
|
cy.get('.import-md-file')
|
|
.click()
|
|
cy.get('div[aria-labelledby="editor-menu-import"] > input[type=file]')
|
|
.attachFile({ filePath: 'import.md', mimeType: 'text/markdown' })
|
|
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span')
|
|
.should('have.text', '# Some short import test file')
|
|
cy.get('.CodeMirror-code > div:nth-of-type(2) > .CodeMirror-line > span > span')
|
|
.should('have.text', ':)')
|
|
})
|
|
|
|
it('import on note with content', () => {
|
|
|
|
cy.get('.CodeMirror')
|
|
.click()
|
|
.get('textarea')
|
|
.fill('test\nabc')
|
|
cy.get('button#editor-menu-import')
|
|
.click()
|
|
cy.get('.import-md-file')
|
|
.click()
|
|
cy.get('div[aria-labelledby="editor-menu-import"] > input[type=file]')
|
|
.attachFile({ filePath: 'import.md', mimeType: 'text/markdown' })
|
|
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span')
|
|
.should('have.text', 'test')
|
|
cy.get('.CodeMirror-code > div:nth-of-type(2) > .CodeMirror-line > span > span')
|
|
.should('have.text', 'abc')
|
|
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line > span > span')
|
|
.should('have.text', '# Some short import test file')
|
|
cy.get('.CodeMirror-code > div:nth-of-type(4) > .CodeMirror-line > span > span')
|
|
.should('have.text', ':)')
|
|
})
|
|
})
|