Skip to content

Commit

Permalink
fix: fix how jurisdiction are converted from middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVicente committed Oct 21, 2020
1 parent f8bb64b commit 19dcf24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/utils/__tests__/index.ts
Expand Up @@ -1961,13 +1961,13 @@ describe('stringToCddId and cddIdToString', () => {
describe('createClaim', () => {
test('createClaim should create Claim objects from claims data provided by middleware', () => {
let type = 'Jurisdiction';
const jurisdiction = CountryCode.Cl;
const jurisdiction = 'CL';
let scope = { type: ClaimScopeTypeEnum.Identity, value: 'someScope' };

let result = createClaim(type, jurisdiction, scope, null);
expect(result).toEqual({
type: ClaimType.Jurisdiction,
code: jurisdiction,
code: CountryCode.Cl,
scope,
});

Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Expand Up @@ -1117,7 +1117,7 @@ export function createClaim(
return {
type,
// this assertion is necessary because CountryCode is not in the middleware types
code: jurisdiction as CountryCode,
code: stringUpperFirst(jurisdiction?.toLowerCase()) as CountryCode,
scope,
};
} else if (type === ClaimType.NoData) {
Expand Down

0 comments on commit 19dcf24

Please sign in to comment.