Add browser save and update workflow
This commit is contained in:
@@ -70,3 +70,62 @@ test("shouldContinueWatchingState keeps polling locked login pages", () => {
|
||||
test("default settings include a blank bearer token that can be overridden by harness patching", () => {
|
||||
assert.equal(background.defaultSettings.bearerToken, "");
|
||||
});
|
||||
|
||||
test("savePlanForObservedLogin prefers updating an exact username match", () => {
|
||||
const plan = background.savePlanForObservedLogin({
|
||||
username: "dannyocean",
|
||||
password: "bellagio-safe",
|
||||
url: "https://vault.example.invalid/login"
|
||||
}, [
|
||||
{
|
||||
id: "vault-console",
|
||||
title: "Vault Console",
|
||||
username: "dannyocean",
|
||||
url: "vault.example.invalid",
|
||||
path: ["Crew", "Internet"]
|
||||
},
|
||||
{
|
||||
id: "bellagio-backup",
|
||||
title: "Bellagio Backup",
|
||||
username: "rustyryan",
|
||||
url: "vault.example.invalid",
|
||||
path: ["Crew", "Internet"]
|
||||
}
|
||||
]);
|
||||
|
||||
assert.deepEqual(plan, {
|
||||
mode: "update",
|
||||
entryId: "vault-console",
|
||||
title: "Vault Console",
|
||||
path: ["Crew", "Internet"],
|
||||
username: "dannyocean",
|
||||
password: "bellagio-safe",
|
||||
url: "https://vault.example.invalid/login"
|
||||
});
|
||||
});
|
||||
|
||||
test("savePlanForObservedLogin falls back to saving into the current page group", () => {
|
||||
const plan = background.savePlanForObservedLogin({
|
||||
username: "linuscaldwell",
|
||||
password: "yellow-chip",
|
||||
url: "https://vault.example.invalid/login"
|
||||
}, [
|
||||
{
|
||||
id: "vault-console",
|
||||
title: "Vault Console",
|
||||
username: "dannyocean",
|
||||
url: "vault.example.invalid",
|
||||
path: ["Crew", "Internet"]
|
||||
}
|
||||
]);
|
||||
|
||||
assert.deepEqual(plan, {
|
||||
mode: "save",
|
||||
entryId: "",
|
||||
title: "vault.example.invalid",
|
||||
path: ["Crew", "Internet"],
|
||||
username: "linuscaldwell",
|
||||
password: "yellow-chip",
|
||||
url: "https://vault.example.invalid/login"
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user