Visual enhancements for dark mode, along with search functionality for service requests and installed base
This commit is contained in:
@@ -143,6 +143,35 @@ function setup() {
|
||||
}
|
||||
const customer = { CustomerAccount: { PartyNumber: "customer-test", PartyUniqueName: "Synthetic customer" } };
|
||||
|
||||
test("service request search covers nested and formatted columns and preserves errors and full results on clearing", () => {
|
||||
const { app, overlay } = setup();
|
||||
const view = app.serviceRequestsView.openServiceRequestsModal(customer);
|
||||
const modal = overlay.children[0];
|
||||
const input = walk(modal).find(node => node.tag === "input");
|
||||
const row = { customer: { name: "S\u00e3o Customer", registryId: "REG-123" }, id: "SR-456", severity: "2", status: "Open",
|
||||
subStatus: "Work In Progress", component: { productName: "Database Alpha" }, os: "Linux", csi: "CSI-789",
|
||||
created: "2026-03-12", lastUpdated: "2026-04-13", hiddenField: "secretword" };
|
||||
input.value = "SAO linux"; input.listeners.input();
|
||||
view.render([row, { id: "Other" }]);
|
||||
const rows = () => walk(modal).filter(node => node.tag === "td").length / 11;
|
||||
assert.equal(rows(), 1);
|
||||
for (const query of ["sao", "REG-123", "SR-456", "2", "open", "progress", "alpha", "linux", "CSI-789", "12/03/2026", "13/04/2026", "2026-03-12"]) {
|
||||
input.value = query; input.listeners.input();
|
||||
assert.equal(rows(), 1, query);
|
||||
}
|
||||
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);
|
||||
view.render([], "Synthetic failure");
|
||||
input.value = "anything"; input.listeners.input();
|
||||
assert.ok(walk(modal).some(node => node.textContent === "Synthetic failure"));
|
||||
app.serviceRequestsView.closeServiceRequestsModal();
|
||||
app.serviceRequestsView.openServiceRequestsModal(customer).render([row]);
|
||||
assert.equal(walk(overlay).filter(node => node.tag === "td").length, 11);
|
||||
});
|
||||
|
||||
test("skeleton, exact field mapping, safe text, dates, badge, empty/error and focus states", () => {
|
||||
const { app, overlay, document } = setup();
|
||||
const trigger = new Element("button", document);
|
||||
@@ -169,6 +198,8 @@ test("skeleton, exact field mapping, safe text, dates, badge, empty/error and fo
|
||||
assert.equal(cells[9].textContent, app.opportunitiesFormatters.formatOracleResponseDate("2026-03-04"));
|
||||
assert.equal(cells[10].textContent, app.opportunitiesFormatters.formatOracleResponseDate("2026-09-17"));
|
||||
modal.listeners.keydown({ key: "Tab", preventDefault() {} });
|
||||
assert.equal(document.activeElement.type, "search");
|
||||
modal.listeners.keydown({ key: "Tab", preventDefault() {} });
|
||||
assert.equal(document.activeElement.attributes.role, "region");
|
||||
view.render([]);
|
||||
assert.ok(walk(modal).some(node => node.textContent === "No open service requests found for this customer."));
|
||||
|
||||
Reference in New Issue
Block a user