Skip to content

ATS-COM-CAT-004Calculate tax from buyer geography: Acceptance Test Set

Markdown

ATS-COM-CAT-004

Calculate tax from buyer geography: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-CAT-004

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

6 scenarios proving CAP-COM-CAT-004; 6 bound to an existing test.

01 Tax-zone validation reports invalid configurationapinegativetest
Proves
BR-CAP-COM-CAT-004-01 BR-CAP-COM-CAT-004-02
Preconditions
A tax-zone request can be submitted
Steps
Use an unassigned country, excessive rate, missing rate name and reversed rate interval
Expected
Validation identifies each issue without saving the zone
Data
none
Bound to
services-commerce:modules/configuration/tests/e2e/tax-zones.e2e.spec.js#answers 400 to a country code that is not two upper-case letters, naming the field
services-commerce:modules/configuration/tests/e2e/tax-zones.e2e.spec.js#answers 400 to a rate past the ceiling and to a rate without a name, naming the field
services-commerce:modules/configuration/tests/e2e/tax-zones.e2e.spec.js#answers 400 to a rate whose effective_from follows its effective_to, naming the field, not the database rule, and saves nothing (DEF-COM-0866)
Source
services-commerce:modules/configuration/tests/e2e/tax-zones.e2e.spec.js#answers 400 to a country code that is not two upper-case letters, naming the field
02 Tax-prefix clearing requires explicit nullunitnegativetest
Proves
BR-CAP-COM-CAT-004-03
Preconditions
A saved zone carries H2X
Steps
Replace its prefix with spaces and then null
Expected
Spaces fail validation; null removes the prefix
Data
none
Bound to
services-commerce:modules/configuration/tests/unit/api/blank-tax-zone-values.spec.js#refuses a whitespace-only postal_code_prefix on a replacement 400 naming the field, instead of clearing H2X
services-commerce:modules/configuration/tests/unit/api/blank-tax-zone-values.spec.js#clears postal_code_prefix on an explicit null, the one way to clear it
Source
services-commerce:modules/configuration/tests/unit/api/blank-tax-zone-values.spec.js#refuses a whitespace-only postal_code_prefix on a replacement 400 naming the field, instead of clearing H2X
03 Tax applicability follows product-type selectionunittest
Proves
BR-CAP-COM-CAT-004-04
Preconditions
Rates include unrestricted and selected-type configurations
Steps
Calculate tax for several product types and submit a list of 101 types
Expected
Only matching rates contribute, and the oversized list fails
Data
none
Bound to
services-commerce:modules/pricing/tests/unit/tax/zone-tax-calculation.spec.js#applies to every product type when it names none, and to the named ones alone otherwise
services-commerce:modules/configuration/tests/unit/api/blank-tax-zone-values.spec.js#refuses 101 product types, one past the limit, naming product_type_ids
Source
services-commerce:modules/pricing/tests/unit/tax/zone-tax-calculation.spec.js#applies to every product type when it names none, and to the named ones alone otherwise
04 Specificity selects the rate components to roundunittest
Proves
BR-CAP-COM-CAT-004-05 BR-CAP-COM-CAT-004-06
Preconditions
Country, region and prefix zones match the address
Steps
Calculate tax for an address matching the prefix zone
Expected
That zone supplies individually rounded components whose sum is the line tax
Data
none
Bound to
services-commerce:modules/pricing/tests/unit/tax/zone-tax-calculation.spec.js#sums every applicable rate per line, each rounded on its own, and names each component
Source
services-commerce:modules/pricing/tests/unit/tax/zone-tax-calculation.spec.js#scores a prefix over a region over a country alone
05 Address requirements differ between checkout and displayunitnegativetest
Proves
BR-CAP-COM-CAT-004-07
Preconditions
A zone can tax every product type
Steps
Request checkout and display calculations without an address
Expected
Checkout refuses the taxable line; display returns zero tax with a warning
Data
none
Bound to
services-commerce:modules/pricing/tests/unit/tax/zone-table-tax.spec.js#refuses a line a zone’s rate for every product type could tax, naming the line and its product
services-commerce:modules/pricing/tests/unit/tax/zone-table-tax.spec.js#answers zero with the no-address warning, not a refusal, reading nothing
Source
services-commerce:modules/pricing/tests/unit/tax/zone-table-tax.spec.js#refuses a line a zone’s rate for every product type could tax, naming the line and its product
06 Tax reads do not grant tax writesapinegativetest
Proves
BR-CAP-COM-CAT-004-10
Preconditions
The caller is a read-only tax user
Steps
Inspect and attempt to change zones
Expected
Inspection succeeds and changes fail permission checks
Data
Read-exclusively persona
Bound to
Source
services-commerce:modules/configuration/tests/e2e/configuration-security.e2e.spec.js#lists and reads the tax zones

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.