mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Fix test
see https://github.com/zenorocha/clipboard.js/pull/807#discussion_r862080076
This commit is contained in:
parent
91c726d4a0
commit
0df402284e
@ -171,15 +171,16 @@ describe('Clipboard', () => {
|
||||
});
|
||||
|
||||
describe('#clearSelection', () => {
|
||||
it('should clear text selection', (done) => {
|
||||
it('should clear text selection without moving focus', (done) => {
|
||||
let clipboard = new Clipboard('.btn');
|
||||
|
||||
clipboard.on('success', (e) => {
|
||||
e.clearSelection();
|
||||
|
||||
let selectedElem = document.activeElement;
|
||||
let selectedText = window.getSelection().toString();
|
||||
|
||||
e.clearSelection();
|
||||
|
||||
assert.equal(selectedElem, e.trigger);
|
||||
assert.equal(selectedText, '');
|
||||
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user