Fix invoicing queue-state unit spec

This commit is contained in:
Jeppe B
2026-07-14 16:05:04 +02:00
parent 9749837506
commit 0e55f45e91
@@ -216,6 +216,11 @@ const mountView = () =>
template:
'<div class="invoice-orders-pagination-stub" :data-customer="setCustomerFilter" :data-order-ids="(showOnlyWithIds || []).join(\',\')" :data-group-invoice-collection="groupInvoiceCollection ? \'true\' : \'false\'" />',
},
InvoicingPeriodObjectTree: {
props: ["customer", "transactions"],
template:
'<div data-testid="invoicing-period-object-tree-stub" :data-customer="customer && customer.customer_number" :data-transaction-count="(transactions || []).length" />',
},
SmallCustomerActivityChart: { template: "<div />" },
InvoicingBillingPeriodCustomerAttributes: { template: "<div />" },
InvoicingBillingPeriodInvoiceProgressBar: { template: "<div />" },
@@ -435,8 +440,10 @@ describe("Invoicing period queue state", () => {
expect(sharedVariablesRef.value.types.all[0].expanded).toBe(true);
expect(sharedVariablesRef.value.types.all[1].expanded).toBe(false);
expect(wrapper.find(".invoice-orders-pagination-stub[data-customer='1001']").exists()).toBe(true);
expect(wrapper.find(".invoice-orders-pagination-stub[data-customer='1002']").exists()).toBe(false);
expect(wrapper.find("[data-testid='invoicing-period-object-tree-stub'][data-customer='1001']").exists()).toBe(true);
expect(wrapper.find("[data-testid='invoicing-period-object-tree-stub'][data-customer='1002']").exists()).toBe(
false
);
await wrapper
.get("[data-testid='invoicing-period-customer-1002'] .columns.is-vcentered.is-clickable")
@@ -445,8 +452,10 @@ describe("Invoicing period queue state", () => {
expect(sharedVariablesRef.value.types.all[0].expanded).toBe(false);
expect(sharedVariablesRef.value.types.all[1].expanded).toBe(true);
expect(wrapper.find(".invoice-orders-pagination-stub[data-customer='1001']").exists()).toBe(false);
expect(wrapper.find(".invoice-orders-pagination-stub[data-customer='1002']").exists()).toBe(true);
expect(wrapper.find("[data-testid='invoicing-period-object-tree-stub'][data-customer='1001']").exists()).toBe(
false
);
expect(wrapper.find("[data-testid='invoicing-period-object-tree-stub'][data-customer='1002']").exists()).toBe(true);
});
it("keeps the invoice action visible for mixed queued and still-unqueued customers", async () => {