Show tax note conditionally and update zero-tax disclaimer wording (#34454)

* Hide tax note when tax is included and update zero-tax disclaimer wording

* fix: update taxes_may_be_added key in all non-English locale files

GitOrigin-RevId: 9cd0e0aba6d548221e97d383b0a2e52a2e0a077c
This commit is contained in:
Rebeka Dekany
2026-06-10 11:59:06 +00:00
committed by Copybot
parent 62c8fd37ac
commit 5a821a055b
11 changed files with 49 additions and 18 deletions
@@ -82,9 +82,17 @@ describe('<ActiveSubscription />', function () {
screen.getByRole('heading', { name: subscription.plan.name, level: 3 })
screen.getByText(
'* Prices may be subject to additional VAT, depending on your country.'
)
if (subscription.payment.taxRate > 0) {
expect(
screen.queryByText(
'* Taxes may be added, depending on your billing address.'
)
).to.be.null
} else {
screen.getByText(
'* Taxes may be added, depending on your billing address.'
)
}
screen.getByRole('link', { name: 'View invoices' })
@@ -4,6 +4,7 @@ import SuccessfulSubscription from '../../../../../../frontend/js/features/subsc
import { renderWithSubscriptionDashContext } from '../../helpers/render-with-subscription-dash-context'
import {
annualActiveSubscription,
annualActiveSubscriptionEuro,
annualActiveSubscriptionPro,
} from '../../fixtures/subscriptions'
import { ExposedSettings } from '../../../../../../types/exposed-settings'
@@ -123,7 +124,7 @@ describe('successful subscription page', function () {
).to.equal(
`The next payment of ${annualActiveSubscriptionPro.payment.displayPrice} will be collected on ${annualActiveSubscriptionPro.payment.nextPaymentDueAt}.`
)
screen.getByText(/prices may be subject to additional vat/i)
screen.getByText(/taxes may be added, depending on your billing address/i)
screen.getByText(/full access to every AI tool/i, { exact: false })
@@ -162,5 +163,27 @@ describe('successful subscription page', function () {
screen.getByRole('heading', { name: /thanks for subscribing/i })
})
it('hides tax disclaimer when tax is already included in the price', function () {
renderWithSubscriptionDashContext(
<UserProvider>
<SuccessfulSubscription />
</UserProvider>,
{
metaTags: [
{
name: 'ol-ExposedSettings',
value: {
adminEmail: 'foo@example.com',
} as ExposedSettings,
},
{ name: 'ol-subscription', value: annualActiveSubscriptionEuro },
{ name: 'ol-isUpgrade', value: true },
],
}
)
expect(screen.queryByText(/taxes may be added/i)).to.be.null
})
})
})