Enable unit preview by default.

TNL-1261
This commit is contained in:
muzaffaryousaf
2015-04-27 11:33:08 +05:00
parent d60b4eed13
commit f5de0bbf43
11 changed files with 93 additions and 58 deletions

View File

@@ -78,15 +78,16 @@ define(["jquery", "underscore", "underscore.string", "js/common_helpers/ajax_hel
respondWithJson(json);
};
describe("PreviewActionController", function () {
describe("ViewLiveButtonController", function () {
var viewPublishedCss = '.button-view',
previewCss = '.button-preview',
visibilityNoteCss = '.note-visibility';
it('renders correctly for unscheduled unit', function () {
renderContainerPage(this, mockContainerXBlockHtml);
expect(containerPage.$(viewPublishedCss)).toHaveClass(disabledCss);
expect(containerPage.$(previewCss)).not.toHaveClass(disabledCss);
expect(containerPage.$(viewPublishedCss).attr('title')).toBe("Open the courseware in the LMS");
expect(containerPage.$('.button-preview')).not.toHaveClass(disabledCss);
expect(containerPage.$('.button-preview').attr('title')).toBe("Preview the courseware in the LMS");
});
it('updates when publish state changes', function () {
@@ -98,19 +99,6 @@ define(["jquery", "underscore", "underscore.string", "js/common_helpers/ajax_hel
expect(containerPage.$(viewPublishedCss)).toHaveClass(disabledCss);
});
it('updates when has_changes attribute changes', function () {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({has_changes: true});
expect(containerPage.$(previewCss)).not.toHaveClass(disabledCss);
fetch({published: true, has_changes: false});
expect(containerPage.$(previewCss)).toHaveClass(disabledCss);
// If published is false, preview is always enabled.
fetch({published: false, has_changes: false});
expect(containerPage.$(previewCss)).not.toHaveClass(disabledCss);
});
it('updates when has_content_group_components attribute changes', function () {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({has_content_group_components: false});