From a8c35683a6a5f1e75d6f21a93f55bc6fb0903b2c Mon Sep 17 00:00:00 2001 From: Beto Muniz Date: Sun, 11 Apr 2021 14:18:57 -0300 Subject: [PATCH] Add tests to static copy/cut methods --- test/clipboard.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/clipboard.js b/test/clipboard.js index 9b3afc1..5c928a4 100644 --- a/test/clipboard.js +++ b/test/clipboard.js @@ -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');