Skip to content

Commit 152c995

Browse files
Fix e2e test invoice number format to match UI display
- Override invoiceNumber in factory calls to use O-00XX format - Use unique invoice numbers for each test to avoid conflicts - Match the pattern used by working one-off payment tests Co-Authored-By: sahil.lavingia@gmail.com <sahil.lavingia@gmail.com>
1 parent d5280c9 commit 152c995

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

e2e/tests/company/invoices/one-off-payments.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,14 @@ test.describe("One-off payments", () => {
394394
companyContractorId: companyContractor.id,
395395
status: "failed",
396396
totalAmountInUsdCents: BigInt(50000),
397+
invoiceNumber: "O-0002",
397398
});
398399

399400
await login(page, adminUser);
400401
await page.goto("/invoices");
401402

402403
const invoiceRow = await findRequiredTableRow(page, {
403-
"Invoice ID": invoice.invoiceNumber,
404+
"Invoice ID": "O-0002",
404405
Amount: "$500.00",
405406
});
406407
await expect(invoiceRow.getByRole("button", { name: "Pay again" })).toBeVisible();
@@ -413,13 +414,14 @@ test.describe("One-off payments", () => {
413414
companyContractorId: companyContractor.id,
414415
status: "approved",
415416
totalAmountInUsdCents: BigInt(50000),
417+
invoiceNumber: "O-0003",
416418
});
417419

418420
await login(page, adminUser);
419421
await page.goto("/invoices");
420422

421423
const invoiceRow = await findRequiredTableRow(page, {
422-
"Invoice ID": invoice.invoiceNumber,
424+
"Invoice ID": "O-0003",
423425
Amount: "$500.00",
424426
});
425427
await invoiceRow.getByRole("button", { name: "Pay now" }).click();

0 commit comments

Comments
 (0)