Skip to content

Commit a341755

Browse files
test: fixing the context mocks paths
1 parent 737000c commit a341755

6 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/App.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jest.mock('data/hooks', () => ({
1111
useInitializeLearnerHome: jest.fn(),
1212
}));
1313

14-
jest.mock('data/context/MasqueradeProvider', () => ({
14+
jest.mock('data/context', () => ({
1515
useMasquerade: jest.fn(() => ({ masqueradeUser: null })),
1616
}));
1717

src/containers/CoursesPanel/index.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jest.mock('data/hooks', () => ({
1414
})),
1515
}));
1616

17-
jest.mock('data/context/FiltersProvider', () => ({
17+
jest.mock('data/context', () => ({
1818
useFilters: jest.fn(() => ({
1919
filters: [],
2020
sortBy: 'enrolled',

src/containers/MasqueradeBar/index.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import MasqueradeBar from '.';
88
// import hooks from './hooks';
99
import messages from './messages';
1010

11-
jest.mock('data/context/MasqueradeProvider', () => ({
11+
jest.mock('data/context', () => ({
1212
useMasquerade: jest.fn(),
1313
}));
1414

src/data/hooks/mutationHooks.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import * as api from '../services/lms/api';
1414

1515
// Mock external dependencies
1616
jest.mock('@edx/frontend-platform/logging');
17-
jest.mock('data/context/MasqueradeProvider');
18-
jest.mock('data/context/BackedDataProvider');
17+
jest.mock('data/context');
1918
jest.mock('data/services/lms/api');
2019

2120
const mockLogError = logError as jest.MockedFunction<typeof logError>;

src/data/hooks/queryHooks.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { renderHook, waitFor } from '@testing-library/react';
22
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3-
import { useMasquerade } from 'data/context';
4-
import { useBackedData } from 'data/context/BackedDataProvider';
3+
import { useMasquerade, useBackedData } from 'data/context';
54
import {
65
useInitializeLearnerHome,
76
} from './index';
87
import * as api from '../services/lms/api';
98

109
// Mock external dependencies
1110
jest.mock('@edx/frontend-platform/logging');
12-
jest.mock('data/context/MasqueradeProvider');
13-
jest.mock('data/context/BackedDataProvider');
11+
jest.mock('data/context');
1412
jest.mock('data/services/lms/api');
1513

1614
const mockUseMasquerade = useMasquerade as jest.MockedFunction<typeof useMasquerade>;

src/hooks/useIsMasquerading.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useMasquerade } from 'data/context';
33
import { useInitializeLearnerHome } from 'data/hooks';
44
import { useIsMasquerading } from 'hooks';
55

6-
jest.mock('data/context/MasqueradeProvider');
6+
jest.mock('data/context');
77
jest.mock('data/hooks');
88

99
const mockUseMasquerade = useMasquerade as jest.MockedFunction<typeof useMasquerade>;

0 commit comments

Comments
 (0)