Some visual adjustments to the badges

This commit is contained in:
2026-10-02 18:44:47 -03:00
parent f512ef9928
commit e9c295be91
12 changed files with 121 additions and 31 deletions

View File

@@ -94,8 +94,8 @@ function setup() {
app.opportunityWorkloadActions.loadProducts = (products, refresh, options) => { if (!options?.cacheOnly) calls.push(products.items[0]?.RevnId || "empty products"); };
app.platformContentMessages.sendRuntimeMessage = async () => ({ ok: true });
app.productsContentJobs.ensureProductsBackgroundMessageHandler();
function start(token = "token") {
app.productsContentJobs.requestOpptyProductsInBackground([{ OptyNumber: "A" }], token);
function start(token = "token", numbers = ["A"]) {
app.productsContentJobs.requestOpptyProductsInBackground(numbers.map(OptyNumber => ({ OptyNumber })), token);
return app.productsContentState.currentProductsRequestId;
}
function progress(requestId, data) {
@@ -147,19 +147,33 @@ test("partial failures use successful products only; closed, failed and empty cy
assert.equal(h.calls.includes("closed"), false);
});
test("cached products restore activities without network; mixed cycles fetch only fresh products", async () => {
test("cached and mixed product cycles both allow activity cache misses to be fetched", async () => {
const h = setup();
const cached = h.start();
h.progress(cached, { optyNumber: "A", items: [{ RevnId: "cached" }], fromCache: true });
h.progress(cached, { state: "complete" });
await flush();
assert.deepEqual(h.calls, []);
const mixed = h.start();
assert.deepEqual(h.calls, ["SR token", "cached"]);
h.calls.length = 0;
const mixed = h.start("token", ["A", "B"]);
h.progress(mixed, { optyNumber: "A", items: [{ RevnId: "cached" }], fromCache: true });
h.progress(mixed, { optyNumber: "B", items: [{ RevnId: "fresh" }], fromCache: false });
h.progress(mixed, { state: "complete" });
await flush();
assert.deepEqual(h.calls, ["SR token", "fresh"]);
assert.deepEqual(h.calls, ["SR token", "cached", "fresh"]);
});
test("activity scope includes hidden reference opportunities and excludes entries from other references", async () => {
const h = setup();
h.app.opportunitiesFilterState.tableSearch = "hide everything";
const id = h.start("token", ["A", "B"]);
h.progress(id, { optyNumber: "A", items: [{ RevnId: "1" }, { RevnId: "2" }] });
h.progress(id, { optyNumber: "B", items: [{ RevnId: "3" }] });
h.progress(id, { optyNumber: "OTHER_REFERENCE", items: [{ RevnId: "outside" }] });
h.progress(id, { state: "complete" });
await flush();
assert.deepEqual(h.calls, ["SR token", "1", "3"]);
assert.equal(h.calls.includes("outside"), false);
});
test("reopening an existing modal does not reload products or reset/query activities", async () => {