Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
magnearun committed Feb 28, 2025
1 parent cd76679 commit 37ec15b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,30 @@ export const scopes: Record<string, Scope> = {
legalGuardian: {
name: '@lg1',
grantToLegalGuardians: true,
supportedDelegationTypes: [AuthDelegationType.LegalGuardian],
},
procurationHolder: {
name: '@ph1',
grantToProcuringHolders: true,
supportedDelegationTypes: [AuthDelegationType.ProcurationHolder],
},
custom: {
name: '@cu1',
allowExplicitDelegationGrant: true,
supportedDelegationTypes: [AuthDelegationType.Custom],
},
custom2: {
name: '@cu2',
allowExplicitDelegationGrant: true,
supportedDelegationTypes: [AuthDelegationType.Custom],
},
representative: {
name: '@pr1',
grantToPersonalRepresentatives: true,
personalRepresentativeRightTypePermissions: [
personalRepresentativeRightTypeCodePostholf,
],
supportedDelegationTypes: [PersonalRepresentativeDelegationType.PersonalRepresentativePostholf],
},
all: {
name: '@all',
Expand All @@ -112,9 +117,16 @@ export const scopes: Record<string, Scope> = {
personalRepresentativeRightTypePermissions: [
personalRepresentativeRightTypeCodePostholf,
],
supportedDelegationTypes: [
AuthDelegationType.LegalGuardian,
AuthDelegationType.ProcurationHolder,
AuthDelegationType.Custom,
AuthDelegationType.PersonalRepresentative,
],
},
none: {
name: '@none',
supportedDelegationTypes: [],
},
}

Expand Down Expand Up @@ -156,6 +168,7 @@ export class TestCase {
grantToProcuringHolders: s.grantToProcuringHolders,
allowExplicitDelegationGrant: s.allowExplicitDelegationGrant,
grantToPersonalRepresentatives: s.grantToPersonalRepresentatives,
supportedDelegationTypes: s.supportedDelegationTypes,
}))
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const FeatureFlagServiceMock = {
getValue: () => true,
getValue: () => Promise.resolve('*'),
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export class DelegationsIndexService {
.getValue(Features.delegationTypesWithNotificationsEnabled, '')
.then((types): Set<string> | '*' | undefined => {
if (!types?.trim()) return undefined; // Empty value means no delegation types allowed
if (types.trim() === '*') return '*'; // All delegation types allowed
return new Set(types.split(',').map((type) => type.trim()));
if (types?.trim() === '*') return '*'; // All delegation types allowed
return new Set(types?.split(',').map((type) => type.trim()));
});

// Case: No allowed delegation types
Expand Down

0 comments on commit 37ec15b

Please sign in to comment.