Skip to content

Commit

Permalink
fix: javascript tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 committed Mar 23, 2024
1 parent 372bb51 commit a2968d0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cms/static/js/spec/views/pages/course_outline_spec.js
Expand Up @@ -72,6 +72,7 @@ describe('CourseOutlinePage', function() {
user_partition_info: {},
highlights_enabled: true,
highlights_enabled_for_messaging: false,
completion_tracking_enabled: true,
show_delete_button: true
}, options, {child_info: {children: children}});
};
Expand All @@ -98,6 +99,7 @@ describe('CourseOutlinePage', function() {
user_partition_info: {},
highlights: [],
highlights_enabled: true,
completion_tracking_enabled: true,
show_delete_button: true
}, options, {child_info: {children: children}});
};
Expand Down Expand Up @@ -129,6 +131,7 @@ describe('CourseOutlinePage', function() {
user_partitions: [],
group_access: {},
user_partition_info: {},
completion_tracking_enabled: true,
show_delete_button: true
}, options, {child_info: {children: children}});
};
Expand All @@ -148,6 +151,7 @@ describe('CourseOutlinePage', function() {
user_partitions: [],
group_access: {},
user_partition_info: {},
completion_tracking_enabled: true,
show_delete_button: true
}, options);
};
Expand Down Expand Up @@ -319,7 +323,7 @@ describe('CourseOutlinePage', function() {
]);
appendSetFixtures(mockOutlinePage);
mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
createMockSectionJSON({completion_tracking_enabled: true}, [
createMockSubsectionJSON({}, [
createMockVerticalJSON()
])
Expand Down Expand Up @@ -1062,16 +1066,16 @@ describe('CourseOutlinePage', function() {
]);

createCourseOutlinePage(this, mockCourseJSON, false);
expect($('.status-message-copy')).toContainText('Optional completion')
expect($('.status-message-copy')).toExist()
outlinePage.$('.subsection-header-actions .configure-button').click();
expectOptionalCompletion(true);
expectOptionalCompletionDisabled(true);
expect($('.tip-warning')).toContainText('This unit already has an optional parent.')
expect($('.tip-warning')).toExist()
$('.wrapper-modal-window .action-cancel').click();
outlinePage.$('.unit-header-actions .configure-button').click();
expectOptionalCompletion(true);
expectOptionalCompletionDisabled(true);
expect($('.tip-warning')).toContainText('This unit already has an optional parent.')
expect($('.tip-warning')).toExist()
});

it('sets optional completion to null instead of false to avoid overriding inheritance', function() {
Expand All @@ -1088,7 +1092,7 @@ describe('CourseOutlinePage', function() {
]);

createCourseOutlinePage(this, mockCourseJSON, false);
expect($('.status-message-copy')).toContainText('Optional completion')
expect($('.status-message-copy')).toExist()
outlinePage.$('.section-header-actions .configure-button').click();
expectOptionalCompletion(true);
$('.wrapper-modal-window .action-save').click();
Expand Down

0 comments on commit a2968d0

Please sign in to comment.