mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
* Support more HTML input types. * Improve test description. Remove .only * Apply logic only when target is an input element
This commit is contained in:
@ -51,5 +51,19 @@ describe('ClipboardActionCopy', () => {
|
||||
|
||||
assert.equal(selectedText, text);
|
||||
});
|
||||
|
||||
it('should select its value in a input number based on text', () => {
|
||||
const value = 1;
|
||||
document.querySelector('#input').setAttribute('type', 'number');
|
||||
document.querySelector('#input').setAttribute('value', value);
|
||||
const selectedText = ClipboardActionCopy(
|
||||
document.querySelector('#input'),
|
||||
{
|
||||
container: document.body,
|
||||
}
|
||||
);
|
||||
|
||||
assert.equal(Number(selectedText), value);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user