Skip to content

Commit

Permalink
Use getSyncedCase from MockData where needed
Browse files Browse the repository at this point in the history
Jira ticket: CAMS-421
  • Loading branch information
jamesobrooks committed Feb 10, 2025
1 parent 967264a commit 9cb2643
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ describe('ConsolidationOrderAccordion tests', () => {
data: [expectedOrderApproved],
});
vi.spyOn(Api2, 'searchCases').mockResolvedValue({
data: MockData.buildArray(MockData.getCaseBasics, 5),
data: MockData.buildArray(MockData.getSyncedCase, 5),
});

renderWithProps();
Expand Down
2 changes: 1 addition & 1 deletion user-interface/src/my-cases/MyCasesScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('MyCasesScreen', () => {
});

test('should render a list of cases assigned to a user', async () => {
const expectedData = MockData.buildArray(MockData.getCaseBasics, 3);
const expectedData = MockData.buildArray(MockData.getSyncedCase, 3);
vi.spyOn(Api2, 'searchCases').mockResolvedValue({
data: expectedData,
});
Expand Down
8 changes: 4 additions & 4 deletions user-interface/src/search/SearchScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MockData } from '@common/cams/test-utilities/mock-data';
import { CaseBasics } from '@common/cams/cases';
import { SyncedCase } from '@common/cams/cases';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import SearchScreen from '@/search/SearchScreen';
Expand All @@ -10,8 +10,8 @@ import { ResponseBody } from '@common/api/response';
import Api2 from '@/lib/models/api2';

describe('search screen', () => {
const caseList = [MockData.getCaseSummary(), MockData.getCaseSummary()];
const searchResponseBody: ResponseBody<CaseBasics[]> = {
const caseList = MockData.buildArray(MockData.getSyncedCase, 2);
const searchResponseBody: ResponseBody<SyncedCase[]> = {
meta: { self: 'self-url' },
pagination: {
count: caseList.length,
Expand All @@ -20,7 +20,7 @@ describe('search screen', () => {
},
data: caseList,
};
const emptySearchResponseBody: ResponseBody<CaseBasics[]> = {
const emptySearchResponseBody: ResponseBody<SyncedCase[]> = {
meta: { self: 'self-url' },
pagination: {
count: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('StaffAssignmentScreen', () => {

test('should render a list of chapter 15 cases for a case assignment manager to review', async () => {
vi.spyOn(Api2, 'searchCases').mockResolvedValue({
data: MockData.buildArray(MockData.getCaseBasics, 3),
data: MockData.buildArray(MockData.getSyncedCase, 3),
});

const expectedPredicate: CasesSearchPredicate = {
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('StaffAssignmentScreen', () => {
vi.spyOn(FeatureFlagHook, 'default').mockReturnValue(mockFeatureFlags);

vi.spyOn(Api2, 'searchCases').mockResolvedValue({
data: MockData.buildArray(MockData.getCaseBasics, 3),
data: MockData.buildArray(MockData.getSyncedCase, 3),
});

const expectedPredicate: CasesSearchPredicate = {
Expand Down

0 comments on commit 9cb2643

Please sign in to comment.