Visual enhancements for dark mode, along with search functionality for service requests and installed base
This commit is contained in:
@@ -100,6 +100,42 @@ function setup() {
|
||||
const customer = { CustomerAccount: { PartyNumber: "customer-123", PartyUniqueName: "Synthetic customer" } };
|
||||
const walk = node => [node, ...node.children.flatMap(walk)];
|
||||
|
||||
test("installed base searches every displayed column and formatted values, including text entered during loading", () => {
|
||||
const { app, overlay, document } = setup();
|
||||
const view = app.installBaseView.openInstallBaseModal(customer);
|
||||
const modal = overlay.children[0];
|
||||
const input = walk(modal).find(node => node.tag === "input");
|
||||
const row = { partyName: "S\u00e3o Customer", productGroupName: "Group Alpha", productName: "Database Beta",
|
||||
currentSupport: 1234.56, orderNumber: "ORD-321", supportStatus: "ACTIVE", quantityType: "Processor",
|
||||
quantity: 7, supportStartDate: "2026-03-12", supportEndDate: "2027-04-13", licenseValue: 9876.54, shipDate: "2020-05-14",
|
||||
hiddenField: "secretword" };
|
||||
input.value = "sao beta";
|
||||
input.listeners.input();
|
||||
assert.equal(modal.attributes["aria-busy"], "true");
|
||||
view.render([row, { productName: "Other product" }]);
|
||||
const rows = () => walk(modal).filter(node => node.tag === "td").length / 12;
|
||||
assert.equal(rows(), 1);
|
||||
for (const query of [...Object.values(row).slice(0, 12), "1,234.56", "9,876.54", "12/03/2026", "13/04/2027", "14/05/2020"]) {
|
||||
input.value = String(query); input.listeners.input();
|
||||
assert.equal(rows(), 1, String(query));
|
||||
assert.equal(walk(modal).find(node => node.tag === "input"), input, "input is not replaced while typing");
|
||||
}
|
||||
input.value = "secretword"; input.listeners.input();
|
||||
assert.equal(rows(), 0);
|
||||
assert.ok(walk(modal).some(node => node.textContent.includes("No matching records.")));
|
||||
input.value = " "; input.listeners.input();
|
||||
assert.equal(rows(), 2);
|
||||
input.focus();
|
||||
modal.listeners.keydown({ key: "Tab", shiftKey: true, preventDefault() {} });
|
||||
assert.equal(document.activeElement.tag, "button");
|
||||
view.render([], "Synthetic failure");
|
||||
input.value = "other"; input.listeners.input();
|
||||
assert.ok(walk(modal).some(node => node.textContent === "Synthetic failure"));
|
||||
app.installBaseView.closeInstallBaseModal();
|
||||
app.installBaseView.openInstallBaseModal(customer).render([row]);
|
||||
assert.equal(walk(overlay).filter(node => node.tag === "td").length, 12, "reopening starts without an invisible filter");
|
||||
});
|
||||
|
||||
test("modal shows skeleton, renders only requested fields safely and ignores closed/replaced responses", () => {
|
||||
const { app, overlay, document } = setup();
|
||||
const first = app.installBaseView.openInstallBaseModal(customer);
|
||||
@@ -122,6 +158,8 @@ test("modal shows skeleton, renders only requested fields safely and ignores clo
|
||||
assert.equal(cells[10].textContent, "0.00");
|
||||
assert.ok(cells[8].textContent.includes("2026"));
|
||||
current.listeners.keydown({ key: "Tab", preventDefault() {} });
|
||||
assert.equal(document.activeElement.type, "search");
|
||||
current.listeners.keydown({ key: "Tab", preventDefault() {} });
|
||||
assert.equal(document.activeElement.attributes.role, "region");
|
||||
assert.equal(app.installBaseView.closeInstallBaseModal(), true);
|
||||
second.render([], "Late error");
|
||||
|
||||
Reference in New Issue
Block a user