ATS-CRM-REG-006Determine an address’s geographic region: Acceptance Test Set
MarkdownDetermine an address’s geographic region: Acceptance Test Set
Coverage
Test Scenarios
9 scenarios proving CAP-CRM-REG-006; 9 bound to an existing test.
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
- 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
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
- 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
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
- 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
- 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
- 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
- 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