feat: updating test coverage

This commit is contained in:
vitormalencar 2021-02-25 16:16:42 +01:00
parent b66010bf77
commit 5d3da80640

View File

@ -37,7 +37,7 @@ describe('ClipboardAction', () => {
}); });
describe('#initSelection', () => { describe('#initSelection', () => {
xit('should set the position right style property', (done) => { it('should set the position right style property', (done) => {
// Set document direction // Set document direction
document.documentElement.setAttribute('dir', 'rtl'); document.documentElement.setAttribute('dir', 'rtl');
@ -47,7 +47,9 @@ describe('ClipboardAction', () => {
text: 'foo', text: 'foo',
}); });
assert.equal(clip.fakeElem.style.right, '-9999px'); const el = clip.createFakeElement();
assert.equal(el.style.right, '-9999px');
done(); done();
}); });
}); });
@ -83,14 +85,16 @@ describe('ClipboardAction', () => {
}); });
describe('#selectText', () => { 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({ let clip = new ClipboardAction({
emitter: new Emitter(), emitter: new Emitter(),
container: document.body, container: document.body,
text: 'blah', text: 'blah',
}); });
assert.equal(clip.selectedText, clip.fakeElem.value); const el = clip.createFakeElement();
assert.equal(clip.selectedText, el.value);
}); });
}); });