Support more HTML input types. Close #800 (#808)

* Support more HTML input types.

* Improve test description. Remove .only

* Apply logic only when target is an input element
This commit is contained in:
Beto Muniz
2022-05-04 14:47:44 -03:00
committed by GitHub
parent 08169bce8c
commit 21db7250ed
5 changed files with 95 additions and 11 deletions

View File

@ -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);
});
});
});