ts: Convert input_pill.js to TypeScript.

Migrated input_pill subsystem to TypeScript, used generics to make
it a generic module so that it works with different implementations
like stream_pill or user_pill.
This commit is contained in:
Lalit
2023-04-08 13:18:21 +05:30
committed by Tim Abbott
parent 83e1d78b7b
commit 833cc71181
3 changed files with 102 additions and 41 deletions

View File

@@ -161,11 +161,10 @@ run_test("copy from pill", ({mock_template}) => {
let copied_text;
const $pill_stub = {
[0]: "<pill-stub RED>",
};
const $pill_stub = "<pill-stub RED>";
const e = {
currentTarget: $pill_stub,
originalEvent: {
clipboardData: {
setData(format, text) {
@@ -177,8 +176,6 @@ run_test("copy from pill", ({mock_template}) => {
preventDefault: noop,
};
$container.set_find_results(":focus", $pill_stub);
copy_handler(e);
assert.equal(copied_text, "RED");