Multi-commit history: - hide drag functionality for entrance exam section. - hide entrance exam subsection elements e.g. delete, drag, name etc. - show unit/verticals expanded in case of entrance exam - modify code in order to allow user to update entrance exam score from UI. - write down unit tests. - write down Jasmine tests. - add bok-choy test - updated bok-choy test - internationalize string - repositioned sequential block creatori - SOL-221 (entrance exam message) - SOL-199 LMS Part (show entrance exam content) and hide the course navigation bar. - redirect the view in case of entrance exam. - update code structure as per suggestions - write down unit tests - fix pep8 - instead of hiding the exam requirement message, now also showing the exam the completion message (success state). - write down unit test to show exam completion message. - Update code as per review suggestions - update doc string - addressed review suggestions - change sequential message text - css adjustments - added new css class for entrance exam score in studio - added Jasmine test for remaning coverage - sequential message should appear under the context of entrance exam subsection. - updated text in CMS and LMS as per suggestions. - added unit text to insure sequential message should not be present in other chapters rather then entrance exam. - skip setter if empty prerequisite course list - exclude logic from xblock_info.js that is specifically related to entrance exam. - added js tests and updated code as per suggestions - added tests - addressed several PR issues - Several small fixes (style, refactoring) - Fixed score update issue - added some more unit tests. - code suggested changes. - addressed PR feedback
54 lines
2.8 KiB
JavaScript
54 lines
2.8 KiB
JavaScript
define(['backbone', 'js/models/xblock_info'],
|
|
function(Backbone, XBlockInfo) {
|
|
describe('XblockInfo isEditableOnCourseOutline', function() {
|
|
it('works correct', function() {
|
|
expect(new XBlockInfo({'category': 'chapter'}).isEditableOnCourseOutline()).toBe(true);
|
|
expect(new XBlockInfo({'category': 'course'}).isEditableOnCourseOutline()).toBe(false);
|
|
expect(new XBlockInfo({'category': 'sequential'}).isEditableOnCourseOutline()).toBe(true);
|
|
expect(new XBlockInfo({'category': 'vertical'}).isEditableOnCourseOutline()).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe('XblockInfo actions state and header visibility ', function() {
|
|
|
|
it('works correct to hide icons e.g. trash icon, drag when actions are not required', function(){
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {'deletable':false}})
|
|
.isDeletable()).toBe(false);
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {'draggable':false}})
|
|
.isDraggable()).toBe(false);
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {'childAddable':false}})
|
|
.isChildAddable()).toBe(false);
|
|
});
|
|
|
|
it('works correct to show icons e.g. trash icon, drag when actions are required', function(){
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {'deletable':true}})
|
|
.isDeletable()).toBe(true);
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {'draggable':true}})
|
|
.isDraggable()).toBe(true);
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {'childAddable':true}})
|
|
.isChildAddable()).toBe(true);
|
|
});
|
|
|
|
it('displays icons e.g. trash icon, drag when actions are undefined', function(){
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {}})
|
|
.isDeletable()).toBe(true);
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {}})
|
|
.isDraggable()).toBe(true);
|
|
expect(new XBlockInfo({'category': 'chapter', 'actions': {}})
|
|
.isChildAddable()).toBe(true);
|
|
});
|
|
|
|
it('works correct to hide header content', function(){
|
|
expect(new XBlockInfo({'category': 'sequential', 'is_header_visible': false})
|
|
.isHeaderVisible()).toBe(false);
|
|
});
|
|
|
|
it('works correct to show header content when is_header_visible is not defined', function() {
|
|
expect(new XBlockInfo({'category': 'sequential', 'actions': {'deletable': true}})
|
|
.isHeaderVisible()).toBe(true);
|
|
});
|
|
|
|
});
|
|
}
|
|
);
|