mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05: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', () => {
|
describe('Code', () => {
|
||||||
beforeEach(() => {
|
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')
|
cy.get('.btn.active.btn-outline-secondary > i.fa-columns')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
cy.get('.CodeMirror textarea')
|
cy.get('.CodeMirror textarea')
|
||||||
|
@ -87,9 +91,6 @@ describe('Code', () => {
|
||||||
cy.get('.markdown-body > pre > div > button > i')
|
cy.get('.markdown-body > pre > div > button > i')
|
||||||
.should('have.class', 'fa-files-o')
|
.should('have.class', 'fa-files-o')
|
||||||
.click()
|
.click()
|
||||||
// This line can be activated if cypress supports copy to clipboard in firefox, too.
|
cy.get('@copy').should('be.calledWithExactly', 'let x = 0\n');
|
||||||
// Please run `yarn add --dev clipboardy`
|
|
||||||
// uncomment cypress plugin
|
|
||||||
// cy.task('getClipboard').should('contain', 'let x = 0\n');
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2020 The HedgeDoc developers (see AUTHORS file)
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
// const clipboardy = require('clipboardy');
|
|
||||||
module.exports = ( on ) => {
|
|
||||||
on('task', {
|
|
||||||
getClipboard () {
|
|
||||||
// return clipboardy.readSync();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
Loading…
Reference in a new issue