mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Replace "cypress-file-upload" with cypress selectFile
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
a32984e052
commit
57f01e8903
6 changed files with 79 additions and 56 deletions
|
@ -7,15 +7,20 @@
|
|||
describe('Import markdown file', () => {
|
||||
beforeEach(() => {
|
||||
cy.visitTestNote()
|
||||
cy.fixture('import.md').as('import')
|
||||
})
|
||||
|
||||
it('import on blank note', () => {
|
||||
cy.getByCypressId('menu-import').click()
|
||||
cy.getByCypressId('menu-import-markdown-button').should('be.visible')
|
||||
cy.getByCypressId('menu-import-markdown-input').attachFixture({
|
||||
filePath: 'import.md',
|
||||
mimeType: 'text/markdown'
|
||||
})
|
||||
cy.getByCypressId('menu-import-markdown-input').selectFile(
|
||||
{
|
||||
contents: '@import',
|
||||
fileName: 'import.md',
|
||||
mimeType: 'text/markdown'
|
||||
},
|
||||
{ force: true }
|
||||
)
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span').should(
|
||||
'have.text',
|
||||
'# Some short import test file'
|
||||
|
@ -27,10 +32,14 @@ describe('Import markdown file', () => {
|
|||
cy.setCodemirrorContent('test\nabc')
|
||||
cy.getByCypressId('menu-import').click()
|
||||
cy.getByCypressId('menu-import-markdown-button').should('be.visible')
|
||||
cy.getByCypressId('menu-import-markdown-input').attachFixture({
|
||||
filePath: 'import.md',
|
||||
mimeType: 'text/markdown'
|
||||
})
|
||||
cy.getByCypressId('menu-import-markdown-input').selectFile(
|
||||
{
|
||||
contents: '@import',
|
||||
fileName: 'import.md',
|
||||
mimeType: 'text/markdown'
|
||||
},
|
||||
{ force: true }
|
||||
)
|
||||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue