Skip to content

ATS-CRM-REG-006Determine an address’s geographic region: Acceptance Test Set

Markdown

ATS-CRM-REG-006

Determine an address’s geographic region: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-CRM-REG-006

KindAcceptance test setProduct areaCRMModuleRegionsRevision2

Read atservices-crm a8d1364freact-console baf6dae3

Test Scenarios

9 scenarios proving CAP-CRM-REG-006; 9 bound to an existing test.

01 Ordering resolves overlapping criteriaunittest
Proves
BR-CAP-CRM-REG-006-01
Preconditions
Two enabled rules both cover the address.
Steps
Evaluate that address.
Expected
The earlier rule’s target wins.
Data
Prepared geographic coverage examples.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers the first rule that matches when several would
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#incomplete addresses and the matcher’s own comparisons › answers the first rule in order when two match (postal code before state)
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers the first rule that matches when several would
02 Fallback is deferred and the final enabled fallback winsunittest
Proves
BR-CAP-CRM-REG-006-02
Preconditions
A fallback precedes geographic coverage and another fallback appears later.
Steps
Evaluate a covered and an uncovered address.
Expected
The geographic target wins for coverage and the later enabled fallback wins otherwise.
Data
Prepared geographic coverage examples.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › tries the rest-of-the-world rule last wherever it sits in the order
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers the rest-of-the-world region when nothing else matches
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers the last rest-of-the-world rule when the tenant has several
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#the rest of the world rule › gives an address no other rule matched the rest of the world region
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › tries the rest-of-the-world rule last wherever it sits in the order
03 Disabled coverage contributes no resultapitest
Proves
BR-CAP-CRM-REG-006-03
Preconditions
A disabled match precedes enabled coverage, and another policy has only a disabled fallback.
Steps
Assign addressed contacts with each policy.
Expected
The enabled coverage wins in the first policy and no region results from the second.
Data
Two independently prepared geographic policies.
Bound to
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a rule staff turned off › skips the disabled rule and answers the next rule that matches
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a rule staff turned off › gives no region when only a disabled rest of the world rule is left, because a disabled rule is no answer
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a rule staff turned off › skips the disabled rule and answers the next rule that matches
04 Text intervals include their endpointsunitnegativetest
Proves
BR-CAP-CRM-REG-006-04
Preconditions
Postal coverage spans the configured five-digit interval.
Steps
Evaluate both endpoints, an interior ZIP+4 and the next uncovered code.
Expected
The endpoints and interior value match while the uncovered code does not.
Data
Postal inputs spanning the relevant boundary cases.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › compares postal codes as strings, so a ZIP+4 code inside the range matches
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › does not match a postal code just past the end of the range
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#incomplete addresses and the matcher’s own comparisons › matches a ZIP+4 postal code inside a five-digit range
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › compares postal codes as strings, so a ZIP+4 code inside the range matches
05 Postal-country restrictions distinguish otherwise equal codesapinegativetest
Proves
BR-CAP-CRM-REG-006-05
Preconditions
Postal coverage is restricted to the United States.
Steps
Evaluate the same code with US, Canadian and omitted country values.
Expected
US and omitted country match; Canada does not.
Data
Three contrasting address inputs.
Bound to
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a postal code rule confined to a country › matches an address in the country the rule names
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a postal code rule confined to a country › refuses the same postal code in another country
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a postal code rule confined to a country › counts an address with no country as US, so a rule confined to US matches it
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a postal code rule confined to a country › matches an address in the country the rule names
06 State matching preserves case sensitivityunitnegativetest
Proves
BR-CAP-CRM-REG-006-06
Preconditions
A rule lists an uppercase state code.
Steps
Evaluate the upper- and lowercase versions.
Expected
Only the uppercase value matches.
Data
Two contrasting address inputs.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › matches states exactly, so a lower-case state is not the upper-case one
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › matches states exactly, so a lower-case state is not the upper-case one
07 Country matching supplies the legacy defaultunittest
Proves
BR-CAP-CRM-REG-006-07
Preconditions
Coverage includes the United States in lowercase.
Steps
Evaluate uppercase, lowercase, blank and missing country values.
Expected
All four inputs match US coverage.
Data
Four address examples for the comparison.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › matches the country whatever the case of the address or the rule
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › counts an address with no country as US
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › matches the country whatever the case of the address or the rule
08 Uncovered addresses can remain unplacedunittest
Proves
BR-CAP-CRM-REG-006-09
Preconditions
The policy contains no fallback.
Steps
Evaluate an address outside its geographic rules.
Expected
The matcher returns no region.
Data
Prepared geographic coverage examples.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers no region when nothing matches and there is no rest-of-the-world rule
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers no region when nothing matches and there is no rest-of-the-world rule
09 An absent address cannot use fallbackunittest
Proves
BR-CAP-CRM-REG-006-10
Preconditions
The policy includes a fallback.
Steps
Evaluate absent and entirely empty address inputs.
Expected
Neither input receives a region.
Data
Prepared geographic coverage examples.
Bound to
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers no region for no address even with a rest-of-the-world rule
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers no region for an address whose every field is empty
Source
services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers no region for no address even with a rest-of-the-world rule

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.