This commit is contained in:
1 parent
646a106e93
commit
12b6e749d8
4 files changed
+66
-8
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user