-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AC-2614] Member access test fix (#10969)
* Initial setup and modifications for member access report api implementation * Adding the permissions logic for getting the permissions text * fixing the test cases * Some refactoring on async calls * Comments on the model * Resolving the mock issue * messages * Localization of text * One more file to fix merge * Fixing test case localization lookup * Fixed permissions lookup (cherry picked from commit cdb4081)
- Loading branch information
Showing
2 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,17 @@ describe("ImportService", () => { | |
const mockOrganizationId = "mockOrgId" as OrganizationId; | ||
const reportApiService = mock<MemberAccessReportApiService>(); | ||
let memberAccessReportService: MemberAccessReportService; | ||
const i18nService = mock<I18nService>(); | ||
const i18nMock = mock<I18nService>({ | ||
t(key) { | ||
return key; | ||
}, | ||
}); | ||
|
||
beforeEach(() => { | ||
reportApiService.getMemberAccessData.mockImplementation(() => | ||
Promise.resolve(memberAccessReportsMock), | ||
); | ||
memberAccessReportService = new MemberAccessReportService(reportApiService, i18nService); | ||
memberAccessReportService = new MemberAccessReportService(reportApiService, i18nMock); | ||
}); | ||
|
||
describe("generateMemberAccessReportView", () => { | ||
|
@@ -92,16 +96,16 @@ describe("ImportService", () => { | |
expect.objectContaining({ | ||
email: "[email protected]", | ||
name: "Sarah Johnson", | ||
twoStepLogin: "On", | ||
accountRecovery: "On", | ||
twoStepLogin: "memberAccessReportTwoFactorEnabledTrue", | ||
accountRecovery: "memberAccessReportAuthenticationEnabledTrue", | ||
group: "Group 1", | ||
totalItems: "20", | ||
}), | ||
expect.objectContaining({ | ||
email: "[email protected]", | ||
name: "James Lull", | ||
twoStepLogin: "Off", | ||
accountRecovery: "Off", | ||
twoStepLogin: "memberAccessReportTwoFactorEnabledFalse", | ||
accountRecovery: "memberAccessReportAuthenticationEnabledFalse", | ||
group: "Group 4", | ||
totalItems: "5", | ||
}), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters