Skip to content

Commit 2253603

Browse files
author
Katelyn Grimes
committed
Fixed last few tests
1 parent 08ea6f6 commit 2253603

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

pages/accountLists/[accountListId]/hrTools/additionalSalaryRequest/index.page.test.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
beforeTestResizeObserver,
1010
} from '__tests__/util/windowResizeObserver';
1111
import { blockImpersonatingNonDevelopers } from 'pages/api/utils/pagePropsHelpers';
12+
import { HcmQuery } from 'src/components/HrTools/Shared/HcmData/Hcm.generated';
1213
import { GetUserQuery } from 'src/components/User/GetUser.generated';
1314
import { UsStaffGroupEnum, UserTypeEnum } from 'src/graphql/types.generated';
1415
import theme from 'src/theme';
@@ -23,18 +24,28 @@ interface TestComponentProps {
2324
const TestComponent: React.FC<TestComponentProps> = ({
2425
userType = UserTypeEnum.UsStaff,
2526
usStaffGroup = UsStaffGroupEnum.SeniorStaff,
26-
staffAccountId = '12345',
27+
staffAccountId = 'account-list-1',
2728
}) => (
2829
<ThemeProvider theme={theme}>
2930
<SnackbarProvider>
3031
<TestRouter router={{ query: { accountListId: 'account-list-1' } }}>
3132
<GqlMockedProvider<{
3233
GetUser: GetUserQuery;
34+
Hcm: HcmQuery;
3335
}>
3436
mocks={{
3537
GetUser: {
3638
user: { userType, usStaffGroup, staffAccountId },
3739
},
40+
Hcm: {
41+
hcm: [
42+
{
43+
asrEit: {
44+
asrEligibility: true,
45+
},
46+
},
47+
],
48+
},
3849
}}
3950
>
4051
<AdditionalSalaryRequestPage />

src/components/HrTools/StaffSavingFund/StaffSavingFundLayout.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,16 @@ describe('StaffSavingFundLayout', () => {
103103

104104
it('renders no staff account page when no staff account', async () => {
105105
const mockNoStaffAccount = {
106-
StaffAccount: {
107-
staffAccount: null,
106+
GetUser: {
107+
user: {
108+
staffAccountId: null,
109+
},
108110
},
109111
};
110112
const { findByText } = render(
111113
<TestRouter>
112114
<GqlMockedProvider<{
113-
StaffAccount: StaffAccountQuery;
115+
GetUser: GetUserQuery;
114116
}>
115117
mocks={mockNoStaffAccount}
116118
onCall={mutationSpy}

0 commit comments

Comments
 (0)