feat: tracking upgrade and discovery (#66)

This commit is contained in:
leangseu-edx
2022-11-10 13:27:04 -05:00
committed by GitHub
parent e92a571cac
commit 48b157fdd0
16 changed files with 129 additions and 28 deletions

View File

@@ -1,22 +1,24 @@
import React from 'react';
import { shallow } from 'enzyme';
import { hooks } from 'data/redux';
import LoadedView from './LoadedView';
import mockData from './mockData';
jest.mock('./components/CourseCard', () => 'CourseCard');
jest.mock('data/redux', () => ({
hooks: {
usePlatformSettingsData: jest.fn(),
usePlatformSettingsData: () => ({
courseSearchUrl: 'course-search-url',
}),
},
}));
const courseSearchUrl = 'test-course-search-url';
hooks.usePlatformSettingsData.mockReturnValue(courseSearchUrl);
describe('RecommendationsPanel LoadedView', () => {
const props = {
courses: mockData.courses,
courseSearchClickTracker: jest.fn().mockName('courseSearchClickTracker'),
};
test('snapshot', () => {
expect(shallow(<LoadedView courses={mockData.courses} />)).toMatchSnapshot();
expect(shallow(<LoadedView {...props} />)).toMatchSnapshot();
});
});