Match the settings popup to the browser/OS dark mode preference
Test / test (push) Waiting to run

This commit is contained in:
Justin Oro
2026-09-02 16:57:01 -07:00
parent 646a106e93
commit 12b6e749d8
4 changed files with 66 additions and 8 deletions
+25
View File
@@ -121,6 +121,31 @@ test("saving an unparseable custom URL is rejected with an error, not saved", as
assert.strictEqual(savedCalls.length, 0, "should not save an invalid URL");
});
test("marks the status message as an error (for themed error styling) on a rejected save", async () => {
const { window } = loadPopupScript();
await wait(20);
const urlPreset = window.document.getElementById("urlPreset");
urlPreset.value = "custom";
urlPreset.dispatchEvent(new window.Event("change"));
window.document.getElementById("customUrl").value = " ";
window.document.getElementById("saveBtn").click();
await wait(20);
assert.strictEqual(window.document.getElementById("status").classList.contains("error"), true);
});
test("does not mark the status message as an error on a successful save", async () => {
const { window } = loadPopupScript();
await wait(20);
window.document.getElementById("saveBtn").click();
await wait(20);
assert.strictEqual(window.document.getElementById("status").classList.contains("error"), false);
});
test("unchecking a toggle and saving persists it as false", async () => {
const { window, savedCalls } = loadPopupScript();
await wait(20);