mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
added copy check in code e2e test (#799)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
74fd6d0630
commit
26b420c500
2 changed files with 6 additions and 19 deletions
|
@ -6,7 +6,11 @@
|
|||
|
||||
describe('Code', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/n/test')
|
||||
cy.visit('/n/test', {
|
||||
onBeforeLoad (win: Window): void {
|
||||
cy.spy(win.navigator.clipboard, 'writeText').as('copy')
|
||||
}
|
||||
})
|
||||
cy.get('.btn.active.btn-outline-secondary > i.fa-columns')
|
||||
.should('exist')
|
||||
cy.get('.CodeMirror textarea')
|
||||
|
@ -87,9 +91,6 @@ describe('Code', () => {
|
|||
cy.get('.markdown-body > pre > div > button > i')
|
||||
.should('have.class', 'fa-files-o')
|
||||
.click()
|
||||
// This line can be activated if cypress supports copy to clipboard in firefox, too.
|
||||
// Please run `yarn add --dev clipboardy`
|
||||
// uncomment cypress plugin
|
||||
// cy.task('getClipboard').should('contain', 'let x = 0\n');
|
||||
cy.get('@copy').should('be.calledWithExactly', 'let x = 0\n');
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue