@@ -4,14 +4,7 @@ import TestRouter from '__tests__/util/TestRouter';
44import { GqlMockedProvider } from '__tests__/util/graphqlMocking' ;
55import { render } from '__tests__/util/testingLibraryReactMock' ;
66import { HcmQuery } from 'src/components/HrTools/Shared/HcmData/Hcm.generated' ;
7- import { StaffAccountQuery } from 'src/components/Shared/StaffAccount/StaffAccount.generated' ;
8- import { GetUserQuery } from 'src/components/User/GetUser.generated' ;
9- import {
10- PeopleGroupSupportTypeEnum ,
11- UsStaffGroupEnum ,
12- UserPersonTypeEnum ,
13- UserTypeEnum ,
14- } from 'src/graphql/types.generated' ;
7+ import { UsStaffGroupEnum , UserTypeEnum } from 'src/graphql/types.generated' ;
158import theme from 'src/theme' ;
169import { RequiredUserGroupEnum , UserTypeAccess } from './UserTypeAccess' ;
1710
@@ -23,11 +16,6 @@ interface TestComponentProps {
2316 usStaffGroup ?: UsStaffGroupEnum ;
2417 staffAccountId ?: string | null ;
2518 requireUserGroups ?: RequiredUserGroupEnum ;
26- asrEligible ?: boolean ;
27- salaryRequestEligible ?: boolean ;
28- designationSupportCalculatorEligible ?: boolean ;
29- peopleGroupSupportType ?: PeopleGroupSupportTypeEnum ;
30- userPersonType ?: UserPersonTypeEnum ;
3119}
3220
3321const TestComponent : React . FC < TestComponentProps > = ( {
@@ -36,30 +24,13 @@ const TestComponent: React.FC<TestComponentProps> = ({
3624 usStaffGroup = UsStaffGroupEnum . PartTimeFieldStaff ,
3725 staffAccountId = id ,
3826 requireUserGroups,
39- asrEligible = true ,
40- salaryRequestEligible = true ,
41- designationSupportCalculatorEligible = true ,
42- peopleGroupSupportType = PeopleGroupSupportTypeEnum . SupportedRmo ,
43- userPersonType = UserPersonTypeEnum . EmployeeHourly ,
4427} ) => (
4528 < ThemeProvider theme = { theme } >
4629 < TestRouter >
4730 < GqlMockedProvider < {
48- StaffAccount : StaffAccountQuery ;
49- GetUser : GetUserQuery ;
5031 Hcm : HcmQuery ;
5132 } >
5233 mocks = { {
53- Hcm : {
54- hcm : [
55- {
56- asrEit : { asrEligibility : asrEligible } ,
57- salaryRequestEligible,
58- designationSupportCalculatorEligible,
59- staffInfo : { peopleGroupSupportType, userPersonType } ,
60- } ,
61- ] ,
62- } ,
6334 GetUser : { user : { userType, usStaffGroup, staffAccountId } } ,
6435 } }
6536 >
@@ -102,7 +73,7 @@ describe('UserTypeAccess', () => {
10273 const { findByRole, getByText } = render (
10374 < TestComponent
10475 requireUserGroups = { RequiredUserGroupEnum . Asr }
105- asrEligible = { false }
76+ usStaffGroup = { UsStaffGroupEnum . PartTimeFieldStaff }
10677 /> ,
10778 ) ;
10879
@@ -122,7 +93,7 @@ describe('UserTypeAccess', () => {
12293 const { findByRole, getByText } = render (
12394 < TestComponent
12495 requireUserGroups = { RequiredUserGroupEnum . SalaryCalc }
125- salaryRequestEligible = { false }
96+ usStaffGroup = { UsStaffGroupEnum . PartTimeFieldStaff }
12697 /> ,
12798 ) ;
12899
@@ -142,7 +113,7 @@ describe('UserTypeAccess', () => {
142113 const { findByRole } = render (
143114 < TestComponent
144115 requireUserGroups = { RequiredUserGroupEnum . MpdGoalCalc }
145- salaryRequestEligible = { false }
116+ usStaffGroup = { UsStaffGroupEnum . PartTimeFieldStaff }
146117 /> ,
147118 ) ;
148119 expect (
@@ -156,7 +127,7 @@ describe('UserTypeAccess', () => {
156127 const { findByRole } = render (
157128 < TestComponent
158129 requireUserGroups = { RequiredUserGroupEnum . PdsGoalCalc }
159- designationSupportCalculatorEligible = { false }
130+ usStaffGroup = { UsStaffGroupEnum . PartTimeFieldStaff }
160131 /> ,
161132 ) ;
162133 expect (
@@ -170,7 +141,6 @@ describe('UserTypeAccess', () => {
170141 const { findByText } = render (
171142 < TestComponent
172143 requireUserGroups = { RequiredUserGroupEnum . PdsGoalCalc }
173- designationSupportCalculatorEligible = { true }
174144 usStaffGroup = { UsStaffGroupEnum . PaidWithDesignation }
175145 /> ,
176146 ) ;
0 commit comments