fix: [AA-1018] api cleanup
Implement review feedback. Clean up tests
This commit is contained in:
@@ -7,7 +7,7 @@ import './tab.factory';
|
||||
export default new Factory()
|
||||
.option('host')
|
||||
.attrs({
|
||||
id: 'course-v1:edX+DemoX+Demo_Course_1',
|
||||
id: 'course-v1:edX+DemoX+Demo_Course',
|
||||
is_staff: false,
|
||||
original_user_is_staff: false,
|
||||
number: 'DemoX',
|
||||
|
||||
@@ -155,7 +155,7 @@ function StreakModal({
|
||||
title={title}
|
||||
onClose={() => {
|
||||
closeStreakCelebration();
|
||||
recordModalClosing('courseHomeMeta', celebrations, org, courseId, dispatch);
|
||||
recordModalClosing(celebrations, org, courseId, dispatch);
|
||||
}}
|
||||
isOpen={isStreakCelebrationOpen}
|
||||
isFullscreenScroll
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('Loaded Tab Page', () => {
|
||||
let axiosMock;
|
||||
const calculateUrl = `${getConfig().ECOMMERCE_BASE_URL}/api/v2/baskets/calculate/?code=ZGY11119949&sku=8CF08E5&username=MockUser`;
|
||||
const courseMetadata = Factory.build('courseMetadata', { celebrations: { streak_length_to_celebrate: 3 } });
|
||||
const courseHomeMetadata = Factory.build('courseHomeMetadata', { id: courseMetadata.id, courseId: courseMetadata.courseId });
|
||||
const courseHomeMetadata = Factory.build('courseHomeMetadata');
|
||||
|
||||
function setDiscount(percent) {
|
||||
mockData.streakDiscountCouponEnabled = true;
|
||||
|
||||
@@ -13,10 +13,10 @@ function recordStreakCelebration(org, courseId) {
|
||||
});
|
||||
}
|
||||
|
||||
function recordModalClosing(metadataModel, celebrations, org, courseId, dispatch) {
|
||||
function recordModalClosing(celebrations, org, courseId, dispatch) {
|
||||
// Ensure we only celebrate each streak once
|
||||
dispatch(updateModel({
|
||||
modelType: metadataModel,
|
||||
modelType: 'courseHomeMeta',
|
||||
model: {
|
||||
id: courseId,
|
||||
celebrations: { ...celebrations, streakLengthToCelebrate: null },
|
||||
|
||||
Reference in New Issue
Block a user