Commit ac977ba4 by Andy Armstrong

Add back and fix missing discussion Jasmine tests

parent 11fa2f37
...@@ -82,10 +82,10 @@ ...@@ -82,10 +82,10 @@
Discussion.prototype.retrieveAnotherPage = function(mode, options, sort_options, error) { Discussion.prototype.retrieveAnotherPage = function(mode, options, sort_options, error) {
var data, url, var data, url,
self = this; self = this;
if (options === null) { if (!options) {
options = {}; options = {};
} }
if (sort_options === null) { if (!sort_options) {
sort_options = {}; sort_options = {};
} }
data = { data = {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
DiscussionUtil.isStaff = function(userId) { DiscussionUtil.isStaff = function(userId) {
var staff; var staff;
if (userId === null) { if (_.isUndefined(userId)) {
userId = this.user ? this.user.id : void 0; userId = this.user ? this.user.id : void 0;
} }
staff = _.union(this.roleIds.Moderator, this.roleIds.Administrator); staff = _.union(this.roleIds.Moderator, this.roleIds.Administrator);
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
DiscussionUtil.isTA = function(userId) { DiscussionUtil.isTA = function(userId) {
var ta; var ta;
if (userId === null) { if (_.isUndefined(userId)) {
userId = this.user ? this.user.id : void 0; userId = this.user ? this.user.id : void 0;
} }
ta = _.union(this.roleIds['Community TA']); ta = _.union(this.roleIds['Community TA']);
......
...@@ -41,7 +41,9 @@ var options = { ...@@ -41,7 +41,9 @@ var options = {
{pattern: 'js/vendor/jasmine-imagediff.js', included: true}, {pattern: 'js/vendor/jasmine-imagediff.js', included: true},
{pattern: 'common/js/spec_helpers/jasmine-extensions.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: [ libraryFiles: [
...@@ -53,6 +55,7 @@ var options = { ...@@ -53,6 +55,7 @@ var options = {
{pattern: 'coffee/src/**/*.js', included: true}, {pattern: 'coffee/src/**/*.js', included: true},
{pattern: 'common/js/xblock/core.js', included: true}, {pattern: 'common/js/xblock/core.js', included: true},
{pattern: 'common/js/xblock/runtime.v1.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/capa/src/**/*.js', included: true},
{pattern: 'js/src/**/*.js', included: true} {pattern: 'js/src/**/*.js', included: true}
], ],
...@@ -60,6 +63,7 @@ var options = { ...@@ -60,6 +63,7 @@ var options = {
specFiles: [ specFiles: [
{pattern: 'coffee/spec/**/*.js', included: true}, {pattern: 'coffee/spec/**/*.js', included: true},
{pattern: 'common/js/spec/xblock/*.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} {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