mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-26 16:31:31 +00:00
a398660c18
* Add function for test attribute Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Adjust components Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Fix naming of attribute Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Rename method Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Rename method, interface, attribute and use interface Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Lint and format fix Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
43 lines
1.6 KiB
TypeScript
43 lines
1.6 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.get('[data-cypress-id="menu-import"]')
|
|
.click()
|
|
cy.get('[data-cypress-id="menu-import-markdown"]')
|
|
.click()
|
|
cy.get('[data-cypress-id="menu-import-markdown-input"]')
|
|
.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.setCodemirrorContent('test\nabc')
|
|
cy.get('[data-cypress-id="menu-import"]')
|
|
.click()
|
|
cy.get('[data-cypress-id="menu-import-markdown"]')
|
|
.click()
|
|
cy.get('[data-cypress-id="menu-import-markdown-input"]')
|
|
.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', ':)')
|
|
})
|
|
})
|