From 5d3da8064040725d3af6b6c8897f58c8d1afdc41 Mon Sep 17 00:00:00 2001 From: vitormalencar Date: Thu, 25 Feb 2021 16:16:42 +0100 Subject: [PATCH] feat: updating test coverage --- test/clipboard-action.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/clipboard-action.js b/test/clipboard-action.js index 3407c39..7084286 100644 --- a/test/clipboard-action.js +++ b/test/clipboard-action.js @@ -37,7 +37,7 @@ describe('ClipboardAction', () => { }); describe('#initSelection', () => { - xit('should set the position right style property', (done) => { + it('should set the position right style property', (done) => { // Set document direction document.documentElement.setAttribute('dir', 'rtl'); @@ -47,7 +47,9 @@ describe('ClipboardAction', () => { text: 'foo', }); - assert.equal(clip.fakeElem.style.right, '-9999px'); + const el = clip.createFakeElement(); + + assert.equal(el.style.right, '-9999px'); done(); }); }); @@ -83,14 +85,16 @@ describe('ClipboardAction', () => { }); describe('#selectText', () => { - xit('should create a fake element and select its value', () => { + it('should create a fake element and select its value', () => { let clip = new ClipboardAction({ emitter: new Emitter(), container: document.body, text: 'blah', }); - assert.equal(clip.selectedText, clip.fakeElem.value); + const el = clip.createFakeElement(); + + assert.equal(clip.selectedText, el.value); }); });