diff --git a/toolkit/content/tests/widgets/test_moz_base_input_element.html b/toolkit/content/tests/widgets/test_moz_base_input_element.html index 34f561683ad6..fd9d78458ac2 100644 --- a/toolkit/content/tests/widgets/test_moz_base_input_element.html +++ b/toolkit/content/tests/widgets/test_moz_base_input_element.html @@ -93,6 +93,29 @@ "support link created" ); }); + + add_task(async function testLabelChange() { + let el = await renderTemplate(); + + let labelEl = el.shadowRoot.querySelector("label"); + is(labelEl.innerText.trim(), "Example label!", "Label is correct"); + is(labelEl.getAttribute("shownaccesskey"), "x", "Accesskey is shown"); + + // Test changing the label text, this could happen when the locale changes. + el.label = "Example new label!"; + await el.updateComplete; + + is( + labelEl.innerText.trim(), + "Example new label!", + "Label is updated correctly" + ); + is( + labelEl.getAttribute("shownaccesskey"), + "x", + "Accesskey is still shown" + ); + });
diff --git a/toolkit/content/tests/widgets/test_moz_label.html b/toolkit/content/tests/widgets/test_moz_label.html index 8d76d1743b0a..7cc3b65e6443 100644 --- a/toolkit/content/tests/widgets/test_moz_label.html +++ b/toolkit/content/tests/widgets/test_moz_label.html @@ -48,6 +48,13 @@ Shownaccesskey highlights the key + + +