From 1e52fe3f1b2b2aa86fac8cb9a66de2552daefa19 Mon Sep 17 00:00:00 2001 From: acoshift Date: Thu, 6 Aug 2026 10:32:41 +0700 Subject: [PATCH] billing: show Company Name label when entity type is company On the create/update billing account form, switch the tax name field label from "Name" to "Company Name" when the entity type is company. Prompter: ACS --- src/routes/(auth)/billing/create/+page.svelte | 2 +- tests/billing.spec.js | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/routes/(auth)/billing/create/+page.svelte b/src/routes/(auth)/billing/create/+page.svelte index 36182d65..f233c625 100644 --- a/src/routes/(auth)/billing/create/+page.svelte +++ b/src/routes/(auth)/billing/create/+page.svelte @@ -104,7 +104,7 @@
- +
diff --git a/tests/billing.spec.js b/tests/billing.spec.js index 43ea8b8c..632abb84 100644 --- a/tests/billing.spec.js +++ b/tests/billing.spec.js @@ -66,6 +66,31 @@ test.describe('billing accounts', () => { const main = page.locator('.content-wrapper') await expect(main.getByText(/don't have access to any billing accounts/)).toBeVisible() }) + + test('create form labels tax name as Company Name when entity type is company', async ({ page }) => { + await page.goto('/billing/create') + + const main = page.locator('.content-wrapper') + const taxNameLabel = main.locator('label[for="input-tax_name"]') + await expect(taxNameLabel).toHaveText('Name') + + await main.locator('#input-type').selectOption('company') + await expect(taxNameLabel).toHaveText('Company Name') + + await main.locator('#input-type').selectOption('individual') + await expect(taxNameLabel).toHaveText('Name') + }) + + test('update form labels tax name as Company Name for a company account', async ({ page }) => { + await setMocks({ + 'billing.get': { ok: true, result: sampleBillingAccount } // type: company + }) + + await page.goto('/billing/create?id=ba-1') + + const main = page.locator('.content-wrapper') + await expect(main.locator('label[for="input-tax_name"]')).toHaveText('Company Name') + }) }) test.describe('invoice detail', () => {