mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Add tests to static copy/cut methods
This commit is contained in:
parent
f267fb88f2
commit
a8c35683a6
@ -126,6 +126,22 @@ describe('Clipboard', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#static copy', () => {
|
||||
it('should copy in an programatic way based on text', () => {
|
||||
assert.equal(Clipboard.copy('lorem'), 'lorem');
|
||||
});
|
||||
|
||||
it('should copy in an programatic way based on target', () => {
|
||||
assert.equal(Clipboard.copy(document.querySelector('span')), 'bar');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#static cut', () => {
|
||||
it('should cut in an programatic way based on text', () => {
|
||||
assert.equal(Clipboard.cut(document.querySelector('span')), 'bar');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#destroy', () => {
|
||||
it('should destroy an existing instance of ClipboardActionDefault', () => {
|
||||
let clipboard = new Clipboard('.btn');
|
||||
|
Loading…
x
Reference in New Issue
Block a user