Align unit contracts with latest master routes and POS UI

This commit is contained in:
Jeppe Bundgaard
2026-04-23 15:47:02 +02:00
parent f6904335dc
commit cc0b238de9
3 changed files with 15 additions and 13 deletions
+6 -6
View File
@@ -74,12 +74,12 @@ describe("edge gateway workspace contract", () => {
expect(manageSource).toContain('data-testid="gateway-settings-page"'); expect(manageSource).toContain('data-testid="gateway-settings-page"');
expect(manageSource).toContain('data-testid="gateway-rotate-confirmation"'); expect(manageSource).toContain('data-testid="gateway-rotate-confirmation"');
expect(manageSource).toContain('data-testid="gateway-delete-confirmation"'); expect(manageSource).toContain('data-testid="gateway-delete-confirmation"');
expect(managerSource).toContain("const mergeStatisticsSnapshot = (statistics, gateway) =>"); expect(managerSource).toContain("const refreshStatisticsSnapshot = async (gatewayId = activeGatewayId.value) =>");
expect(managerSource).toContain("const localGateway = findLocalGatewaySnapshot(gatewayId);"); expect(managerSource).toContain(
expect(managerSource).toContain("if (payload?.gateway && !localGateway)"); 'statisticsSnapshot.value = payload && typeof payload === "object" ? payload : {};'
expect(managerSource).toContain("statisticsSnapshot.value = mergeStatisticsSnapshot("); );
expect(managerSource).toContain("payload || {},"); expect(managerSource).toContain("if (statisticsSnapshot.value?.gateway) {");
expect(managerSource).toContain("localGateway || payload?.gateway || null"); expect(managerSource).toContain("setSelectedGatewaySnapshot(statisticsSnapshot.value.gateway);");
}); });
it("mounts a module workspace and a safe-subset department workspace", () => { it("mounts a module workspace and a safe-subset department workspace", () => {
+6 -6
View File
@@ -312,9 +312,9 @@ describe("SelectVehicleFormPOS", () => {
await wrapper.get('[data-testid="expandable-toggle"]').trigger("click"); await wrapper.get('[data-testid="expandable-toggle"]').trigger("click");
await nextTick(); await nextTick();
expect(wrapper.findAll('[data-testid="customer-search-field-pos-stub"]')).toHaveLength(2); expect(wrapper.findAll('[data-testid="customer-search-field-pos-stub"]')).toHaveLength(1);
expect(wrapper.findAll('[data-testid="customer-search-new-customer-stub"]')).toHaveLength(2); expect(wrapper.findAll('[data-testid="customer-search-new-customer-stub"]')).toHaveLength(1);
expect(wrapper.findAll('[data-testid="customer-search-card-payment-stub"]')).toHaveLength(2); expect(wrapper.findAll('[data-testid="customer-search-card-payment-stub"]')).toHaveLength(1);
}); });
it("moves customer selection into the expanded other section for linked vehicles", async () => { it("moves customer selection into the expanded other section for linked vehicles", async () => {
@@ -328,8 +328,8 @@ describe("SelectVehicleFormPOS", () => {
await wrapper.get('[data-testid="expandable-toggle"]').trigger("click"); await wrapper.get('[data-testid="expandable-toggle"]').trigger("click");
await nextTick(); await nextTick();
expect(wrapper.findAll('[data-testid="customer-search-field-pos-stub"]')).toHaveLength(1); expect(wrapper.findAll('[data-testid="customer-search-field-pos-stub"]')).toHaveLength(2);
expect(wrapper.findAll('[data-testid="customer-search-new-customer-stub"]')).toHaveLength(1); expect(wrapper.findAll('[data-testid="customer-search-new-customer-stub"]')).toHaveLength(2);
expect(wrapper.findAll('[data-testid="customer-search-card-payment-stub"]')).toHaveLength(1); expect(wrapper.findAll('[data-testid="customer-search-card-payment-stub"]')).toHaveLength(2);
}); });
}); });
@@ -8,7 +8,9 @@ const recordPageSource = readFileSync(join(root, "src/views/search/SystemSearchR
describe("system search generic record route contract", () => { describe("system search generic record route contract", () => {
it("registers authenticated generic record route in router", () => { it("registers authenticated generic record route in router", () => {
expect(routerSource).toContain('import SystemSearchRecordPage from "@/views/search/SystemSearchRecordPage.vue";'); expect(routerSource).toContain(
"const SystemSearchRecordPage = lazyView('@/views/search/SystemSearchRecordPage.vue');"
);
expect(routerSource).toContain("name: 'systemsearchrecord'"); expect(routerSource).toContain("name: 'systemsearchrecord'");
expect(routerSource).toContain("path: '/search/system/record/:entityType/:entityId'"); expect(routerSource).toContain("path: '/search/system/record/:entityType/:entityId'");
expect(routerSource).toContain("component: SystemSearchRecordPage"); expect(routerSource).toContain("component: SystemSearchRecordPage");