status: READY state gains 'Check for updates' button wired to the sync flow (previously no way to pull a newer package once READY)
This commit is contained in:
parent
873f300116
commit
bb40c96f98
2 changed files with 15 additions and 0 deletions
|
|
@ -170,6 +170,10 @@ export function createStatusView(
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case "READY":
|
case "READY":
|
||||||
|
// READY must still be able to pull a newer published package;
|
||||||
|
// onGetData runs the sync flow ("You already have the latest"
|
||||||
|
// when there is nothing new).
|
||||||
|
buttons.append(actionButton("Check for updates", actions.onGetData));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
buttons.append(actionButton("Check my data", actions.onCheckData));
|
buttons.append(actionButton("Check my data", actions.onCheckData));
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,17 @@ describe("Status view", () => {
|
||||||
expect(view.querySelectorAll(".status-check--ok")).toHaveLength(2);
|
expect(view.querySelectorAll(".status-check--ok")).toHaveLength(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("READY offers Check for updates wired to the sync flow", () => {
|
||||||
|
const a = actions();
|
||||||
|
const view = createStatusView(report(), a);
|
||||||
|
const btn = [...view.querySelectorAll("button")].find(
|
||||||
|
(b) => b.textContent === "Check for updates",
|
||||||
|
);
|
||||||
|
expect(btn).toBeTruthy();
|
||||||
|
btn?.dispatchEvent(new MouseEvent("click"));
|
||||||
|
expect(a.onGetData).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
|
|
||||||
it("PARTIAL enumerates missing and offers Continue setup", () => {
|
it("PARTIAL enumerates missing and offers Continue setup", () => {
|
||||||
const a = actions();
|
const a = actions();
|
||||||
const view = createStatusView(
|
const view = createStatusView(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue