Skip to content

ATS-CRM-REG-004Build the geographic assignment policy: Acceptance Test Set

Markdown

ATS-CRM-REG-004

Build the geographic assignment policy: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-CRM-REG-004

KindAcceptance test setProduct areaCRMModuleRegionsRevision2

Read atservices-crm a8d1364freact-console baf6dae3

Test Scenarios

8 scenarios proving CAP-CRM-REG-004; 7 bound to an existing test.

01 Unknown rule kinds are invalidapinegativetest
Proves
BR-CAP-CRM-REG-004-01
Preconditions
A settings record exists.
Steps
Attempt to store an unsupported rule kind.
Expected
The rule-kind constraint rejects it.
Data
No extra fixture records are required.
Bound to
Source
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule constraints › refuses a rule type outside the legacy list
02 Criteria lists require valid bounded contentapinegativetest
Proves
BR-CAP-CRM-REG-004-02
Preconditions
The workspace contains a target region.
Steps
Submit missing postal ranges, empty states or countries, too many states and a range with a blank endpoint.
Expected
Each invalid list is refused and no replacement policy is committed.
Data
Criteria lists constructed at the required boundary sizes.
Bound to
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 400 for a postal code rule with no ranges
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule constraints › refuses a state rule with more than 1000 states
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#postal code range constraints › refuses a range position beyond 1000
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 400 for a postal code rule with no ranges
03 Rule normalization removes unrelated criteriaapitest
Proves
BR-CAP-CRM-REG-004-03
Preconditions
A target region exists.
Steps
Create a state rule also carrying a country restriction and postal ranges.
Expected
Only the state criteria remain on the saved rule.
Data
A single regional definition.
Bound to
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#drops a country given on a rule that is not a postal code rule, as it drops the other types’ lists
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule constraints › refuses states on a rule that is not a state rule
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#drops a country given on a rule that is not a postal code rule, as it drops the other types’ lists
04 Postal restrictions use valid country codesapinegativetest
Proves
BR-CAP-CRM-REG-004-04
Preconditions
A target region exists.
Steps
Create postal rules with a lowercase two-letter code and an invalid three-letter code.
Expected
The valid code is stored in capitals and the invalid code is refused.
Data
A single regional definition.
Bound to
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 400 for a country that is not an ISO 3166-1 alpha-2 code
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers the created rule with its ranges, its country upper-cased and its note
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule constraints › refuses a country that is not two upper-case letters, because it is an ISO 3166-1 alpha-2 code
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 400 for a country that is not an ISO 3166-1 alpha-2 code
05 Foreign and absent rule targets are rejectedapinegativetest
Proves
BR-CAP-CRM-REG-004-06
Preconditions
Two workspaces contain separate regions.
Steps
Save rules targeting a nonexistent region and the other workspace’s region.
Expected
Both requests identify the missing local target and preserve the saved policy.
Data
Two distinct customer workspaces.
Bound to
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › refuses a rule naming a region the tenant does not have, naming it
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#refusals › refuses settings whose rule names a region the tenant does not have
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule constraints › refuses a rule naming a region of another tenant
Source
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › refuses a rule naming a region the tenant does not have, naming it
06 The policy cannot exceed its rule limitapinegativeproposed
Proves
BR-CAP-CRM-REG-004-08
Preconditions
The workspace already holds one thousand rules.
Steps
Add one rule and submit a whole list containing one thousand and one rules.
Expected
Both requests are rejected while the existing policy remains intact.
Data
A policy populated to its one-thousand-entry limit.
Source
services-crm:modules/regions/aws/api/regions.schemas.ts:regionAssignmentSettingsSchema; services-crm:modules/regions/services/persistence/region-assignment-settings.ts:createRegionAssignmentRule
07 Omitted rules preserve the listapitest
Proves
BR-CAP-CRM-REG-004-09
Preconditions
The settings hold three rules.
Steps
Replace with two different rules, then save settings without a rules property.
Expected
The first replacement establishes the new ordered pair and the second retains it.
Data
A three-entry assignment policy.
Bound to
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#leaves the rules alone when the body carries none, so switching the settings on keeps them
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#reads the replaced rules and their ranges back exactly as the save answered them
Source
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › replaces the rules whole on the next save
08 Rule identity and position remain validapinegativetest
Proves
BR-CAP-CRM-REG-004-10
Preconditions
A target region exists.
Steps
Save three rules, then attempt duplicate positions and a zero position directly.
Expected
The saved rules have identifiers and positions one through three; invalid positions are rejected.
Data
A single regional definition.
Bound to
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › gives every rule it saved an id of its own, because a rule is a record a console can now manage one at a time
Source
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › gives every rule it saved an id of its own, because a rule is a record a console can now manage one at a time

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.