mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
Add image placeholder and upload indicating frame (#1666)
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
58fecc0b3a
commit
d4251519e2
37 changed files with 908 additions and 72 deletions
|
@ -16,16 +16,16 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span').should('have.text', '```abnf')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line > span > span').should('have.text', '```')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line').contains('```abnf')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line').contains('```')
|
||||
cy.getMarkdownBody().findById('highlighted-code-block').should('exist')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent('```')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span').should('have.text', '```abnf')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line > span > span').should('have.text', '```')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line').contains('```abnf')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line').contains('```')
|
||||
cy.getMarkdownBody().findById('highlighted-code-block').should('exist')
|
||||
})
|
||||
})
|
||||
|
@ -36,17 +36,17 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span').should('have.text', ':::success')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line > span > span').should('have.text', '::: ')
|
||||
cy.getMarkdownBody().find('div.alert').should('exist')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line').contains(':::success')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line').contains('::: ')
|
||||
cy.getMarkdownBody().find('.alert').should('exist')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent(':::')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span').should('have.text', ':::success')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line > span > span').should('have.text', '::: ')
|
||||
cy.getMarkdownBody().find('div.alert').should('exist')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line').contains(':::success')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(3) > .CodeMirror-line').contains('::: ')
|
||||
cy.getMarkdownBody().find('.alert').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -57,13 +57,13 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', ':hedgehog:')
|
||||
cy.get('.CodeMirror-activeline').contains(':hedgehog:')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent(':hedg')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', ':hedgehog:')
|
||||
cy.get('.CodeMirror-activeline').contains(':hedgehog:')
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -73,13 +73,13 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', ':fa-facebook:')
|
||||
cy.get('.CodeMirror-activeline').contains(':fa-facebook:')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent(':fa-face')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', ':fa-facebook:')
|
||||
cy.get('.CodeMirror-activeline').contains(':fa-facebook:')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -90,14 +90,14 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '# ')
|
||||
cy.get('.CodeMirror-activeline').contains('# ')
|
||||
cy.getMarkdownBody().find('h1').should('have.text', '\n ')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent('#')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '# ')
|
||||
cy.get('.CodeMirror-activeline').contains('# ')
|
||||
cy.getMarkdownBody().find('h1').should('have.text', '\n ')
|
||||
})
|
||||
})
|
||||
|
@ -108,23 +108,15 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '')
|
||||
cy.getMarkdownBody()
|
||||
.find('p > img')
|
||||
.should('have.attr', 'alt', 'image alt')
|
||||
.should('have.attr', 'src', 'https://')
|
||||
.should('have.attr', 'title', 'title')
|
||||
cy.get('.CodeMirror-activeline').contains('')
|
||||
cy.getMarkdownBody().find('.image-drop').should('exist')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent('!')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '')
|
||||
cy.getMarkdownBody()
|
||||
.find('p > img')
|
||||
.should('have.attr', 'alt', 'image alt')
|
||||
.should('have.attr', 'src', 'https://')
|
||||
.should('have.attr', 'title', 'title')
|
||||
cy.get('.CodeMirror-activeline').contains('')
|
||||
cy.getMarkdownBody().find('.image-drop').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -134,7 +126,7 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '[link text](https:// "title") ')
|
||||
cy.get('.CodeMirror-activeline').contains('[link text](https:// "title") ')
|
||||
cy.getMarkdownBody()
|
||||
.find('p > a')
|
||||
.should('have.text', 'link text')
|
||||
|
@ -145,7 +137,7 @@ describe('Autocompletion works for', () => {
|
|||
cy.setCodemirrorContent('[')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '[link text](https:// "title") ')
|
||||
cy.get('.CodeMirror-activeline').contains('[link text](https:// "title") ')
|
||||
cy.getMarkdownBody()
|
||||
.find('p > a')
|
||||
.should('have.text', 'link text')
|
||||
|
@ -160,14 +152,14 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '{%pdf https:// %}')
|
||||
cy.get('.CodeMirror-activeline').contains('{%pdf https:// %}')
|
||||
cy.getMarkdownBody().find('p').should('exist')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent('{')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '{%pdf https:// %}')
|
||||
cy.get('.CodeMirror-activeline').contains('{%pdf https:// %}')
|
||||
cy.getMarkdownBody().find('p').should('exist')
|
||||
})
|
||||
})
|
||||
|
@ -178,14 +170,14 @@ describe('Autocompletion works for', () => {
|
|||
cy.get('.CodeMirror-hints').should('exist')
|
||||
cy.get('@codeinput').type('{enter}')
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '</details>') // after selecting the hint, the last line of the inserted suggestion is active
|
||||
cy.get('.CodeMirror-activeline').contains('</details>') // after selecting the hint, the last line of the inserted suggestion is active
|
||||
cy.getMarkdownBody().find('details').should('exist')
|
||||
})
|
||||
it('via doubleclick', () => {
|
||||
cy.setCodemirrorContent('<d')
|
||||
cy.get('.CodeMirror-hints > li').first().dblclick()
|
||||
cy.get('.CodeMirror-hints').should('not.exist')
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span').should('have.text', '</details>')
|
||||
cy.get('.CodeMirror-activeline').contains('</details>')
|
||||
cy.getMarkdownBody().find('details').should('exist')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue