In canUserCreateTeam(), look in this.context.userInfo for staff/priveleged attributes.
This commit is contained in:
committed by
Alex Dusenbery
parent
6fbfc328ee
commit
31498cc414
@@ -367,7 +367,7 @@ To run JavaScript tests in a browser, run these commands::
|
||||
To debug these tests on devstack in a local browser:
|
||||
|
||||
* first run the appropriate test_js_dev command from above which will open a browser using XQuartz
|
||||
* open http://edx.devstack.lms:19876/debug.html in your host system's browser of choice
|
||||
* open http://localhost:19876/debug.html in your host system's browser of choice
|
||||
* this will run all the tests and show you the results including details of any failures
|
||||
* you can click on an individually failing test and/or suite to re-run it by itself
|
||||
* you can now use the browser's developer tools to debug as you would any other JavaScript code
|
||||
|
||||
@@ -86,23 +86,38 @@ define([
|
||||
});
|
||||
|
||||
it('does not show actions for a user already in a team', function() {
|
||||
var teamsView = createTopicTeamsView({myTeamsCollection: TeamSpecHelpers.createMockTeams()});
|
||||
var options = {myTeamsCollection: TeamSpecHelpers.createMockTeams()};
|
||||
var teamsView = createTopicTeamsView(options);
|
||||
verifyActions(teamsView, {showActions: false});
|
||||
});
|
||||
|
||||
it('does not show actions for a student in an instructor managed topic', function() {
|
||||
var teamsView = createTopicTeamsView({privileged: false}, true);
|
||||
var teamsView = createTopicTeamsView({}, true);
|
||||
verifyActions(teamsView, {showActions: false});
|
||||
});
|
||||
|
||||
it('shows actions for a privileged user already in a team', function() {
|
||||
var teamsView = createTopicTeamsView({privileged: true});
|
||||
verifyActions(teamsView);
|
||||
var options = {
|
||||
userInfo: {
|
||||
privileged: true,
|
||||
staff: false
|
||||
},
|
||||
myTeamsCollection: TeamSpecHelpers.createMockTeams()
|
||||
};
|
||||
var teamsView = createTopicTeamsView(options);
|
||||
verifyActions(teamsView, {showActions: true});
|
||||
});
|
||||
|
||||
it('shows actions for a staff user already in a team', function() {
|
||||
var teamsView = createTopicTeamsView({privileged: false, staff: true});
|
||||
verifyActions(teamsView);
|
||||
var options = {
|
||||
userInfo: {
|
||||
privileged: false,
|
||||
staff: true
|
||||
},
|
||||
myTeamsCollection: TeamSpecHelpers.createMockTeams()
|
||||
};
|
||||
var teamsView = createTopicTeamsView(options);
|
||||
verifyActions(teamsView, {showActions: true});
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
// that they create. This means that if multiple team membership is
|
||||
// disabled that they cannot create a new team when they already
|
||||
// belong to one.
|
||||
return this.context.staff
|
||||
|| this.context.privileged
|
||||
return this.context.userInfo.staff
|
||||
|| this.context.userInfo.privileged
|
||||
|| (!TeamUtils.isInstructorManagedTopic(this.model.attributes.type)
|
||||
&& this.myTeamsCollection.length === 0);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user