Commit 518a428f by Andy Armstrong Committed by GitHub

Merge pull request #12845 from edx/andya/fix-discussion-jasmine-tests

Add back and fix missing discussion Jasmine tests
parents 8e57e248 ac977ba4
......@@ -82,10 +82,10 @@
Discussion.prototype.retrieveAnotherPage = function(mode, options, sort_options, error) {
var data, url,
self = this;
if (options === null) {
if (!options) {
options = {};
}
if (sort_options === null) {
if (!sort_options) {
sort_options = {};
}
data = {
......
......@@ -30,7 +30,7 @@
DiscussionUtil.isStaff = function(userId) {
var staff;
if (userId === null) {
if (_.isUndefined(userId)) {
userId = this.user ? this.user.id : void 0;
}
staff = _.union(this.roleIds.Moderator, this.roleIds.Administrator);
......@@ -39,7 +39,7 @@
DiscussionUtil.isTA = function(userId) {
var ta;
if (userId === null) {
if (_.isUndefined(userId)) {
userId = this.user ? this.user.id : void 0;
}
ta = _.union(this.roleIds['Community TA']);
......
......@@ -41,7 +41,9 @@ var options = {
{pattern: 'js/vendor/jasmine-imagediff.js', included: true},
{pattern: 'common/js/spec_helpers/jasmine-extensions.js', included: true},
{pattern: 'common/js/spec_helpers/jasmine-waituntil.js', included: true}
{pattern: 'common/js/spec_helpers/jasmine-waituntil.js', included: true},
{pattern: 'common/js/spec_helpers/discussion_spec_helper.js', included: true},
{pattern: 'common/js/spec/discussion/view/discussion_view_spec_helper.js', included: true}
],
libraryFiles: [
......@@ -53,6 +55,7 @@ var options = {
{pattern: 'coffee/src/**/*.js', included: true},
{pattern: 'common/js/xblock/core.js', included: true},
{pattern: 'common/js/xblock/runtime.v1.js', included: true},
{pattern: 'common/js/discussion/**/*.js', included: true},
{pattern: 'js/capa/src/**/*.js', included: true},
{pattern: 'js/src/**/*.js', included: true}
],
......@@ -60,6 +63,7 @@ var options = {
specFiles: [
{pattern: 'coffee/spec/**/*.js', included: true},
{pattern: 'common/js/spec/xblock/*.js', included: true},
{pattern: 'common/js/spec/discussion/**/*spec.js', included: true},
{pattern: 'js/**/*spec.js', included: true}
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment