Add tests to static copy/cut methods

This commit is contained in:
Beto Muniz 2021-04-11 14:18:57 -03:00
parent f267fb88f2
commit a8c35683a6

View File

@ -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', () => { describe('#destroy', () => {
it('should destroy an existing instance of ClipboardActionDefault', () => { it('should destroy an existing instance of ClipboardActionDefault', () => {
let clipboard = new Clipboard('.btn'); let clipboard = new Clipboard('.btn');