mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-27 04:01:04 +00:00
03725f5512
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com>
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
describe('Import markdown file', () => {
|
|
beforeEach(() => {
|
|
cy.visitTestEditor()
|
|
})
|
|
|
|
it('import on blank note', () => {
|
|
cy.getById('menu-import').click()
|
|
cy.getById('menu-import-markdown-button').should('be.visible')
|
|
cy.getById('menu-import-markdown-input').attachFixture({
|
|
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.setCodemirrorContent('test\nabc')
|
|
cy.getById('menu-import').click()
|
|
cy.getById('menu-import-markdown-button').should('be.visible')
|
|
cy.getById('menu-import-markdown-input').attachFixture({
|
|
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', ':)')
|
|
})
|
|
})
|