mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
feat: updating test coverage
This commit is contained in:
parent
b66010bf77
commit
5d3da80640
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user