diff --git a/src/ui/views/status/status.ts b/src/ui/views/status/status.ts index 4fee8dd..43f2d75 100644 --- a/src/ui/views/status/status.ts +++ b/src/ui/views/status/status.ts @@ -170,6 +170,10 @@ export function createStatusView( ); break; 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; } buttons.append(actionButton("Check my data", actions.onCheckData)); diff --git a/tests/unit/status.test.ts b/tests/unit/status.test.ts index 6a5ecdf..5331083 100644 --- a/tests/unit/status.test.ts +++ b/tests/unit/status.test.ts @@ -72,6 +72,17 @@ describe("Status view", () => { 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", () => { const a = actions(); const view = createStatusView(