Add unit test for HtmlSelectElement binding. (#598)

This commit is contained in:
Tyler Wilcock
2018-08-01 00:01:03 -05:00
committed by Alex Crichton
parent 26a3e57536
commit c1f182cca7
6 changed files with 110 additions and 3 deletions

View File

@@ -38,6 +38,19 @@ export function new_script() {
return document.createElement("script");
}
export function new_select_with_food_opts() {
let select = document.createElement("select");
let opts = ["tomato", "potato", "orange", "apple"];
for(let i = 0; i < opts.length; i++) {
let opt = document.createElement("option");
opt.value = opts[i];
opt.text = opts[i];
select.appendChild(opt);
}
return select;
}
export function new_span() {
return document.createElement("span");
}