Some visual adjustments to the badges
This commit is contained in:
@@ -64,6 +64,29 @@ function contentFixture(send) {
|
||||
return app;
|
||||
}
|
||||
|
||||
test("Actions progress counts product workloads, not opportunities, even with filters", async () => {
|
||||
const pending = new Map();
|
||||
const app = contentFixture(message => new Promise(resolve => pending.set(message.revnId, resolve)));
|
||||
const progress = [];
|
||||
app.activityProgress.update = (...args) => progress.push(args);
|
||||
app.opportunitiesFilterState.tableSearch = "hidden";
|
||||
const a = { items: [{ RevnId: "1" }, { RevnId: "2" }] };
|
||||
const b = { items: [{ RevnId: "3" }] };
|
||||
app.productsContentState.opptyProductsByNumber = new Map([["A", a], ["B", b]]);
|
||||
const loading = [app.opportunityWorkloadActions.loadProducts(a), app.opportunityWorkloadActions.loadProducts(b)];
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
assert.equal(pending.size, 3);
|
||||
pending.get("1")({ ok: true, actions: [], hasNext: false });
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
assert.deepEqual(progress.at(-1), ["actions", "running", 1, 3]);
|
||||
pending.get("2")({ ok: true, actions: [], hasNext: false });
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
assert.deepEqual(progress.at(-1), ["actions", "running", 2, 3]);
|
||||
pending.get("3")({ ok: true, actions: [], hasNext: false });
|
||||
await Promise.all(loading);
|
||||
assert.deepEqual(progress.at(-1), ["actions", "complete", 3, 3]);
|
||||
});
|
||||
|
||||
test("saved response updates the workload badge, tooltip and matching cache without fetching", async () => {
|
||||
const app = contentFixture(() => assert.fail("Save response must not trigger a GET"));
|
||||
const writes = [];
|
||||
|
||||
Reference in New Issue
Block a user