---
id: TST-CRM-REG-065
title: Geographic matching and deciding input
kind: unit
product_area: crm
module: regions
revision: 1
status: draft
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
repository: services-crm
files:
  - modules/regions/tests/unit/region-matching.spec.js
implements:
  - ATS-CRM-REG-006-01
  - ATS-CRM-REG-006-02
  - ATS-CRM-REG-006-04
  - ATS-CRM-REG-006-06
  - ATS-CRM-REG-006-07
  - ATS-CRM-REG-006-08
  - ATS-CRM-REG-006-09
  - ATS-CRM-REG-006-11
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 2
isolation: In-memory values and test-owned component state.
evidence:
  - 'services-crm:modules/regions/tests/unit/region-matching.spec.js'
assertions:
  - scenario: ATS-CRM-REG-006-01
    source: >-
      services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers the
      first rule that matches when several would
  - scenario: ATS-CRM-REG-006-02
    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
  - scenario: ATS-CRM-REG-006-02
    source: >-
      services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers the
      rest-of-the-world region when nothing else matches
  - scenario: ATS-CRM-REG-006-02
    source: >-
      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
  - scenario: ATS-CRM-REG-006-04
    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
  - scenario: ATS-CRM-REG-006-04
    source: >-
      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
  - scenario: ATS-CRM-REG-006-06
    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
  - scenario: ATS-CRM-REG-006-07
    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
  - scenario: ATS-CRM-REG-006-07
    source: >-
      services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › counts an
      address with no country as US
  - scenario: ATS-CRM-REG-006-08
    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
  - scenario: ATS-CRM-REG-006-09
    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
  - scenario: ATS-CRM-REG-006-09
    source: >-
      services-crm:modules/regions/tests/unit/region-matching.spec.js#region_for_address › answers no
      region for an address whose every field is empty
  - scenario: ATS-CRM-REG-006-11
    source: >-
      services-crm:modules/regions/tests/unit/region-matching.spec.js#refuses a rule type it does not
      know
binding_scope: >-
  Exact assertion anchors identify the contribution of this file. Scenario-level bindings may compose
  several files; registration does not assert that every file alone executes every scenario step.
---

# Geographic matching and deciding input

## Verification Boundary

The suite exercises regional calculations, declarations or console components with test inputs. Its assertions do not establish deployed service behavior.

## What This Suite Proves

The linked source assertions contribute checks for ordering resolves overlapping criteria; fallback is deferred and the final enabled fallback wins; text intervals include their endpoints; state matching preserves case sensitivity; country matching supplies the legacy default; uncovered addresses can remain unplaced; an absent address cannot use fallback; unsupported criteria fail instead of choosing a target. A scenario spanning several files relies on those assertions together; this file supplies only its named checks.

## What It Does Not Prove

The register establishes neither a current passing run nor verified conformance. Unbound scenarios, broader feature chains and the delegated infrastructure beyond this execution boundary remain unproved.

## Real Dependencies and Test Doubles

Test inputs, execution contexts, request clients or component dependencies are supplied by the suite. Database persistence and deployed transport are outside this boundary.

## Must Not Be Doubled

The calculation, permission declaration or console behavior under assertion must remain the real implementation.
