From eb42826fa527cb66d02498ada70f2a7a069574c1 Mon Sep 17 00:00:00 2001 From: thetif Date: Thu, 20 Apr 2017 22:19:56 -0600 Subject: [PATCH] more tests --- .../csv-file-upload.client.directive.js | 3 - .../controllers/lessons.server.controller.js | 1 - .../import-team-members.client.controller.js | 1 - .../client/views/profiles.client.view.html | 19 ++-- .../tests/e2e/common-profiles.e2e.tests.js | 31 +++++- .../organization-lead-profile.e2e.tests.js | 30 ++++++ .../e2e/organization-profile.e2e.tests.js | 30 ++++++ .../profiles/tests/e2e/profiles.e2e.tests.js | 102 ++++++++++++++++++ .../restoration-station-profile.e2e.tests.js | 30 ++++++ .../tests/e2e/team-lead-profile.e2e.tests.js | 30 ++++++ .../e2e/team-member-profile.e2e.tests.js | 30 ++++++ .../tests/e2e/team-profile.e2e.tests.js | 30 ++++++ .../e2e/restoration-stations.e2e.tests.js | 28 +---- .../school-orgs.server.controller.js | 4 +- .../users/tests/e2e/common-users.e2e.tests.js | 43 +++++++- .../sample-data-tests/bop-school-orgs.json | 2 +- .../sample-data-tests/bop-teams.json | 3 +- .../sample-data-tests/bop-users.json | 7 +- 18 files changed, 372 insertions(+), 52 deletions(-) create mode 100644 modules/profiles/tests/e2e/profiles.e2e.tests.js diff --git a/modules/forms/client/directives/csv-file-upload.client.directive.js b/modules/forms/client/directives/csv-file-upload.client.directive.js index 9ecb4ebf0..b8372c8e7 100644 --- a/modules/forms/client/directives/csv-file-upload.client.directive.js +++ b/modules/forms/client/directives/csv-file-upload.client.directive.js @@ -90,10 +90,8 @@ }); element.on('change', function(onChangeEvent) { - console.log('csv change'); if (onChangeEvent && onChangeEvent.target && onChangeEvent.target.files && onChangeEvent.target.files.length && onChangeEvent.target.files[0] && onChangeEvent.target.files[0].name) { - console.log('filename', onChangeEvent.target.files[0].name); var reader = new FileReader(); scope.filename = onChangeEvent.target.files[0].name; reader.onload = function(onLoadEvent) { @@ -125,7 +123,6 @@ } } } else if (onChangeEvent && onChangeEvent.target && !onChangeEvent.target.files) { - console.log('no files'); scope.filename = null; angular.element('input[type="file"]').val(null); } diff --git a/modules/lessons/server/controllers/lessons.server.controller.js b/modules/lessons/server/controllers/lessons.server.controller.js index f676f4e4e..97f650c8c 100644 --- a/modules/lessons/server/controllers/lessons.server.controller.js +++ b/modules/lessons/server/controllers/lessons.server.controller.js @@ -840,7 +840,6 @@ exports.list = function(req, res) { } if (req.query.byCreator) { - console.log('byCreator', req.query.byCreator); if (req.query.byCreator === 'true') { and.push({ 'user': req.user }); } else { diff --git a/modules/profiles/client/controllers/team-member/import-team-members.client.controller.js b/modules/profiles/client/controllers/team-member/import-team-members.client.controller.js index 2137257f8..cfd39bd8d 100644 --- a/modules/profiles/client/controllers/team-member/import-team-members.client.controller.js +++ b/modules/profiles/client/controllers/team-member/import-team-members.client.controller.js @@ -19,7 +19,6 @@ headersValid: false, filename: '' }; - console.log('reset', $scope.csv); $scope.bulkFileUploaded = false; diff --git a/modules/profiles/client/views/profiles.client.view.html b/modules/profiles/client/views/profiles.client.view.html index 399baff62..979626553 100644 --- a/modules/profiles/client/views/profiles.client.view.html +++ b/modules/profiles/client/views/profiles.client.view.html @@ -4,24 +4,25 @@
{{vm.user.displayName}}

{{vm.user.displayName}}

-

{{vm.user.username}}
{{vm.user.email}}

-

+

{{vm.user.username}}
{{vm.user.email}}

+


-
+
Organization

{{vm.organization.name}}
{{vm.organization.city}}, {{vm.organization.state}}


-
+
{{vm.teams.length > 1 ? 'Teams' : 'Team'}}

{{team.name}}
- {{team.teamLead.displayName}} + {{lead.displayName}}{{($last) ? '' : ', '}} +


@@ -115,7 +116,7 @@


-
+
{{team.teamLeads.length}} {{(team.teamLeads.length > 1) ? 'Team Leads' : 'Team Lead'}}

{{teamLead.displayName}} {{team.teamLeads.length}}

{{team.teamMembers.length}} team members
-
+
{{(team.expeditions) ? team.expeditions.length : 0}} Published Expeditions
  • @@ -138,14 +139,14 @@
    {{(team.expeditions) ?
-
+
diff --git a/modules/profiles/tests/e2e/common-profiles.e2e.tests.js b/modules/profiles/tests/e2e/common-profiles.e2e.tests.js index 863d52e0b..4dc2165aa 100644 --- a/modules/profiles/tests/e2e/common-profiles.e2e.tests.js +++ b/modules/profiles/tests/e2e/common-profiles.e2e.tests.js @@ -3,6 +3,33 @@ var path = require('path'), EC = protractor.ExpectedConditions; +var station1 = { + name: 'Test Station', + location: { + latitude: '39.765', + longitude: '-76.234' + }, + bodyOfWater: 'Flushing Bay', + boroughCounty: 'Queens', + shoreLineText: 'Fixed Pier', + statusText: 'Active', + siteCoordinatorName: 'Site1 Coordinator', + propertyOwnerName: 'Property1' +}; +var station2 = { + name: 'Other Station', + location: { + latitude: '39.765', + longitude: '-76.234' + }, + bodyOfWater: 'Bronx River', + boroughCounty: 'Bronx', + shoreLineText: 'Dirt/Sand', + statusText: 'Active', + siteCoordinatorName: 'Site2 Coordinator', + propertyOwnerName: 'Property2' +}; + var assertORSProfile = function(values, teamLead, organization, isAdmin, isOwner) { // Station image if (values.photo) { @@ -72,5 +99,7 @@ var assertORSProfile = function(values, teamLead, organization, isAdmin, isOwner }; module.exports = { - assertORSProfile: assertORSProfile + assertORSProfile: assertORSProfile, + station1: station1, + station2: station2 }; diff --git a/modules/profiles/tests/e2e/organization-lead-profile.e2e.tests.js b/modules/profiles/tests/e2e/organization-lead-profile.e2e.tests.js index e69de29bb..df1fac0bf 100644 --- a/modules/profiles/tests/e2e/organization-lead-profile.e2e.tests.js +++ b/modules/profiles/tests/e2e/organization-lead-profile.e2e.tests.js @@ -0,0 +1,30 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; +}); diff --git a/modules/profiles/tests/e2e/organization-profile.e2e.tests.js b/modules/profiles/tests/e2e/organization-profile.e2e.tests.js index e69de29bb..df1fac0bf 100644 --- a/modules/profiles/tests/e2e/organization-profile.e2e.tests.js +++ b/modules/profiles/tests/e2e/organization-profile.e2e.tests.js @@ -0,0 +1,30 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; +}); diff --git a/modules/profiles/tests/e2e/profiles.e2e.tests.js b/modules/profiles/tests/e2e/profiles.e2e.tests.js new file mode 100644 index 000000000..e200bf9c0 --- /dev/null +++ b/modules/profiles/tests/e2e/profiles.e2e.tests.js @@ -0,0 +1,102 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var leader2 = CommonUser.leader2; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var member3 = CommonUser.member3; + var member4 = CommonUser.member4; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var team2 = CommonUser.team2; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; + + var assertProfile = function(values, organization, teams, isTeamLead, isTeamMember) { + //Profile image + expect(element(by.css('img[class="img-circle img-responsive center-block"]')).isDisplayed()).toBe(true); + //Name + var name = element(by.css('a[ng-click="vm.openViewUserModal(vm.user)"]')); + expect(name.isDisplayed()).toBe(true); + expect(name.getText()).toEqual(values.displayName); + //Contact + var contact = element(by.id('profile-view-contact')); + expect(contact.isDisplayed()).toBe(true); + expect(contact.getText()).toEqual(values.username + '\n' + values.email); + //Research interests + var research = element(by.id('profile-view-research-interests')); + expect(research.isDisplayed()).toBe(true); + if (values.researchInterestsText) expect(research.getText()).toEqual(values.researchInterestsText); + + var createTeamButton = element(by.css('a[ng-click="vm.openTeamProfileForm()"]')); + if (isTeamLead) { + expect(createTeamButton.isDisplayed()).toBe(true); + } else { + expect(createTeamButton.isDisplayed()).toBe(false); + } + + //Sidebar Organization + var sideOrganization = element(by.id('profile-view-side-organization')); + if (organization) { + expect(sideOrganization.getText()).toEqual('ORGANIZATION\n' + organization.name + '\n' + organization.city + ', ' + organization.state); + expect(element(by.css('a[ui-sref="profiles.organization-view({ schoolOrgId: vm.organization._id })"]')).isDisplayed()).toBe(true); + } + + var sideTeams = element(by.id('profile-view-side-teams')); + if (teams) { + var sideTeamsText = ((teams.length > 1) ? 'TEAMS' : 'TEAM') + '\n'; + for (var i = 0; i < teams.length; i++) { + sideTeamsText += teams[i].name; + if (isTeamMember || i < teams.length-1) { + sideTeamsText += '\n'; + } + if (isTeamMember) { + for (var j = 0; j < teams[i].teamLeads.length; j++) { + sideTeamsText += teams[i].teamLeads[j].displayName; + if (j < teams[i].teamLeads.length-1) { + sideTeamsText += ', '; + } + } + } + } + expect(sideTeams.isDisplayed()).toBe(true); + expect(sideTeams.getText()).toEqual(sideTeamsText); + } + + expect(element(by.cssContainingText('.btn-default', 'Edit profile')).isDisplayed()).toBe(true); + expect(element(by.cssContainingText('.btn-default', 'Change profile picture')).isDisplayed()).toBe(true); + expect(element(by.cssContainingText('.btn-default', 'Change password')).isDisplayed()).toBe(true); + }; + + describe('Profile View', function() { + it('should allow team lead to view their profile', function() { + //Sign in as leader + signinAs(leader); + //Assert that it went to correct opening page + expect(browser.getCurrentUrl()).toEqual('http://localhost:8081/restoration'); + browser.get('http://localhost:8081/profiles'); + + assertProfile(leader, organization, [team, team2], true, false); + }); + }); +}); diff --git a/modules/profiles/tests/e2e/restoration-station-profile.e2e.tests.js b/modules/profiles/tests/e2e/restoration-station-profile.e2e.tests.js index e69de29bb..df1fac0bf 100644 --- a/modules/profiles/tests/e2e/restoration-station-profile.e2e.tests.js +++ b/modules/profiles/tests/e2e/restoration-station-profile.e2e.tests.js @@ -0,0 +1,30 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; +}); diff --git a/modules/profiles/tests/e2e/team-lead-profile.e2e.tests.js b/modules/profiles/tests/e2e/team-lead-profile.e2e.tests.js index e69de29bb..df1fac0bf 100644 --- a/modules/profiles/tests/e2e/team-lead-profile.e2e.tests.js +++ b/modules/profiles/tests/e2e/team-lead-profile.e2e.tests.js @@ -0,0 +1,30 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; +}); diff --git a/modules/profiles/tests/e2e/team-member-profile.e2e.tests.js b/modules/profiles/tests/e2e/team-member-profile.e2e.tests.js index e69de29bb..df1fac0bf 100644 --- a/modules/profiles/tests/e2e/team-member-profile.e2e.tests.js +++ b/modules/profiles/tests/e2e/team-member-profile.e2e.tests.js @@ -0,0 +1,30 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; +}); diff --git a/modules/profiles/tests/e2e/team-profile.e2e.tests.js b/modules/profiles/tests/e2e/team-profile.e2e.tests.js index e69de29bb..df1fac0bf 100644 --- a/modules/profiles/tests/e2e/team-profile.e2e.tests.js +++ b/modules/profiles/tests/e2e/team-profile.e2e.tests.js @@ -0,0 +1,30 @@ +'use strict'; + +var path = require('path'), + moment = require('moment'), + CommonUser = require('../../../users/tests/e2e/common-users.e2e.tests'), + signinAs = CommonUser.signinAs, + signout = CommonUser.signout, + signup = CommonUser.signup, + CommonExpedition = require('../../../expeditions/tests/e2e/common-expeditions.e2e.tests'), + uploadImage = CommonExpedition.uploadImage, + assertImage = CommonExpedition.assertImage, + defaultMapCoordinates = CommonExpedition.defaultMapCoordinates, + assertMapCoordinates = CommonExpedition.assertMapCoordinates, + CommonProfiles = require('../../../profiles/tests/e2e/common-profiles.e2e.tests'), + assertORSProfile = CommonProfiles.assertORSProfile, + EC = protractor.ExpectedConditions; + +describe('Profile E2E Tests', function() { + var admin = CommonUser.admin; + var leader = CommonUser.leader; + var member1 = CommonUser.member1; + var member2 = CommonUser.member2; + var newLeader = CommonUser.newLeader; + var newStudent = CommonUser.newStudent; + var team = CommonUser.team; + var organization = CommonUser.organization; + + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; +}); diff --git a/modules/restoration-stations/tests/e2e/restoration-stations.e2e.tests.js b/modules/restoration-stations/tests/e2e/restoration-stations.e2e.tests.js index 53530a028..3197846e8 100644 --- a/modules/restoration-stations/tests/e2e/restoration-stations.e2e.tests.js +++ b/modules/restoration-stations/tests/e2e/restoration-stations.e2e.tests.js @@ -23,32 +23,8 @@ describe('Restoration Station E2E Tests', function() { var team = CommonUser.team; var organization = CommonUser.organization; - var station1 = { - name: 'Test Station', - location: { - latitude: '39.765', - longitude: '-76.234' - }, - bodyOfWater: 'Flushing Bay', - boroughCounty: 'Queens', - shoreLineText: 'Fixed Pier', - statusText: 'Active', - siteCoordinatorName: 'Site1 Coordinator', - propertyOwnerName: 'Property1' - }; - var station2 = { - name: 'Other Station', - location: { - latitude: '39.765', - longitude: '-76.234' - }, - bodyOfWater: 'Bronx River', - boroughCounty: 'Bronx', - shoreLineText: 'Dirt/Sand', - statusText: 'Active', - siteCoordinatorName: 'Site2 Coordinator', - propertyOwnerName: 'Property2' - }; + var station1 = CommonProfiles.station1; + var station2 = CommonProfiles.station2; var station3 = { name: 'New Station 1', location: { diff --git a/modules/school-orgs/server/controllers/school-orgs.server.controller.js b/modules/school-orgs/server/controllers/school-orgs.server.controller.js index dbdb213fa..487f34810 100644 --- a/modules/school-orgs/server/controllers/school-orgs.server.controller.js +++ b/modules/school-orgs/server/controllers/school-orgs.server.controller.js @@ -63,8 +63,8 @@ var findTeamStats = function(orgToFind, callback) { teamLeads = teamLeads.concat(teams[i].teamLeads); teamMembers = teamMembers.concat(teams[i].teamMembers); } - teamLeads = _.uniq(teamLeads); - teamMembers = _.uniq(teamMembers); + teamLeads = _.uniqWith(teamLeads, _.isEqual); + teamMembers = _.uniqWith(teamMembers, _.isEqual); } org.teams = { teamLeads: teamLeads, diff --git a/modules/users/tests/e2e/common-users.e2e.tests.js b/modules/users/tests/e2e/common-users.e2e.tests.js index 449559fee..0e0eb6d14 100644 --- a/modules/users/tests/e2e/common-users.e2e.tests.js +++ b/modules/users/tests/e2e/common-users.e2e.tests.js @@ -47,21 +47,39 @@ module.exports = { displayName: 'Admin Local' }, leader: { - username: 'teacher', + username: 'teacher1', password: 'P@$$w0rd!!', - displayName: 'Teacher Local', - email: 'teacher@localhost.com' + displayName: 'Teacher1 Local', + email: 'teacher1@localhost.com', + researchInterestsText: 'I\'m interested in teaching.' + }, + leader2: { + username: 'teacher2', + password: 'P@$$w0rd!!', + displayName: 'Teacher2 Local', + email: 'teacher2@localhost.com' }, member1: { username: 'student1', password: 'P@$$w0rd!!', - displayName: 'Student1 Local' + displayName: 'Student1 Local', + researchInterestsText: 'I want to learn.' }, member2: { username: 'student2', password: 'P@$$w0rd!!', displayName: 'Student2 Local' }, + member3: { + username: 'student3', + password: 'P@$$w0rd!!', + displayName: 'Student3 Local' + }, + member4: { + username: 'student4', + password: 'P@$$w0rd!!', + displayName: 'Student4 Local' + }, newLeader: { firstName: 'New Leader', lastName: 'Local', @@ -90,7 +108,22 @@ module.exports = { password: 'P@$$w0rd!!', displayName: 'New Student Local' }, - team: { name: 'Test Team' }, + team: { + name: 'Test Team1', + teamLeads: [{ + displayName: 'Teacher1 Local' + }, { + displayName: 'Teacher2 Local' + }] + }, + team2: { + name: 'Test Team2', + teamLeads: [{ + displayName: 'Teacher1 Local' + }, { + displayName: 'Teacher2 Local' + }] + }, organization: { name: 'Org1', city: 'Anytown', diff --git a/scripts/mongo-load/sample-data-tests/bop-school-orgs.json b/scripts/mongo-load/sample-data-tests/bop-school-orgs.json index 3b497aeac..393a69b4b 100644 --- a/scripts/mongo-load/sample-data-tests/bop-school-orgs.json +++ b/scripts/mongo-load/sample-data-tests/bop-school-orgs.json @@ -1 +1 @@ -{"_id":{"$oid":"57bdd911c0ff26078ba63509"},"latitude":39.765,"longitude":-76.234,"pending":false,"state":"NY","city":"Anytown","streetAddress":"123 Main St","description":"Test Organization","organizationType":"school","name":"Org1","created":{"$date":"2016-08-24T17:27:45.543Z"},"__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba63509"},"latitude":39.765,"longitude":-76.234,"pending":false,"state":"NY","city":"Anytown","streetAddress":"123 Main St","description":"Test Organization","organizationType":"school","name":"Org1","orgLeads":[{"$oid":"57bdd911c0ff26078ba6350b"},{"$oid":"57bdd911c0ff26078ba63512"}],"created":{"$date":"2016-08-24T17:27:45.543Z"},"__v":0} diff --git a/scripts/mongo-load/sample-data-tests/bop-teams.json b/scripts/mongo-load/sample-data-tests/bop-teams.json index 747a07800..28870d7a6 100644 --- a/scripts/mongo-load/sample-data-tests/bop-teams.json +++ b/scripts/mongo-load/sample-data-tests/bop-teams.json @@ -1 +1,2 @@ -{"_id":{"$oid":"57bdd911c0ff26078ba6350e"},"teamLead":{"$oid":"57bdd911c0ff26078ba6350b"},"schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"name":"Test Team","teamMembers":[{"$oid":"57bdd911c0ff26078ba6350c"},{"$oid":"57bdd911c0ff26078ba6350d"}],"created":{"$date":"2016-08-24T17:27:45.552Z"},"__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba6350e"},"teamLead":{"$oid":"57bdd911c0ff26078ba6350b"},"teamLeads":[{"$oid":"57bdd911c0ff26078ba6350b"}],"schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"name":"Test Team1","teamMembers":[{"$oid":"57bdd911c0ff26078ba6350c"},{"$oid":"57bdd911c0ff26078ba6350d"}],"created":{"$date":"2016-08-24T17:27:45.552Z"},"__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba6350f"},"teamLead":{"$oid":"57bdd911c0ff26078ba6350b"},"teamLeads":[{"$oid":"57bdd911c0ff26078ba6350b"},{"$oid":"57bdd911c0ff26078ba63512"}],"schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"name":"Test Team2","teamMembers":[{"$oid":"57bdd911c0ff26078ba63510"},{"$oid":"57bdd911c0ff26078ba63511"}],"created":{"$date":"2016-08-24T17:27:45.552Z"},"__v":0} diff --git a/scripts/mongo-load/sample-data-tests/bop-users.json b/scripts/mongo-load/sample-data-tests/bop-users.json index 08137db30..bc591b896 100644 --- a/scripts/mongo-load/sample-data-tests/bop-users.json +++ b/scripts/mongo-load/sample-data-tests/bop-users.json @@ -1,6 +1,9 @@ {"_id":{"$oid":"57bdd911c0ff26078ba6350a"},"salt":"sZxEQ7ZtfCbI6o4yQiX66w==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"admin","provider":"local","displayName":"Admin Local","pending":false,"created":{"$date":"2016-08-24T17:27:45.549Z"},"roles":["user","admin"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"L4kgYosCxcBwyb9gLEfbiNbICX7n8kOkMbu27VnX2H9zDlVlo4/G6RQYopmTux+9Xphuyp9O/IU2ls/CAXwAXw==","email":"admin@localhost.com","lastName":"Local","firstName":"Admin","__v":0} -{"_id":{"$oid":"57bdd911c0ff26078ba6350b"},"salt":"sZxEQ7ZtfCbI6o4yQiX66w==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"teacher","provider":"local","displayName":"Teacher Local","teamLeadType":"teacher","pending":false,"created":{"$date":"2016-08-24T17:27:45.549Z"},"roles":["user","team lead"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"L4kgYosCxcBwyb9gLEfbiNbICX7n8kOkMbu27VnX2H9zDlVlo4/G6RQYopmTux+9Xphuyp9O/IU2ls/CAXwAXw==","email":"teacher@localhost.com","lastName":"Local","firstName":"Teacher","__v":0} -{"_id":{"$oid":"57bdd911c0ff26078ba6350c"},"salt":"rwAj4ScC5vlRX09JJE8Vvw==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"student1","provider":"local","displayName":"Student1 Local","pending":false,"created":{"$date":"2016-08-24T17:27:45.551Z"},"roles":["user","team member"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"UTKrxWHDiVtf23jRUSGktZ3YXmoPxoiB1v0VOKYy8bW5NdtzwPcOIMG6Gy71HevYy9+3gCn0RlLkMAsAfqaPlg==","email":"student1@localhost.com","lastName":"Local","firstName":"Student1","__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba6350b"},"salt":"sZxEQ7ZtfCbI6o4yQiX66w==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"teacher1","provider":"local","displayName":"Teacher1 Local","teamLeadType":"teacher","pending":false,"created":{"$date":"2016-08-24T17:27:45.549Z"},"roles":["user","team lead"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"L4kgYosCxcBwyb9gLEfbiNbICX7n8kOkMbu27VnX2H9zDlVlo4/G6RQYopmTux+9Xphuyp9O/IU2ls/CAXwAXw==","email":"teacher1@localhost.com","lastName":"Local","firstName":"Teacher1","researchInterests":"

I'm interested in teaching.

","__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba63512"},"salt":"OOyh1J6jgkNdJzZRKEopFQ==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"teacher2","provider":"local","displayName":"Teacher2 Local","teamLeadType":"teacher","pending":false,"created":{"$date":"2016-08-24T17:27:45.549Z"},"roles":["user","team lead"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"TmoJFlWjD82oBCd3u4heQwx7bk3lHOhOe4P8oF80t2MWFgqpY7aEnivMOQIFmGIbBcaDsRqEmrC4sD8Mjh3Hcw==","email":"teacher2@localhost.com","lastName":"Local","firstName":"Teacher2","__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba6350c"},"salt":"rwAj4ScC5vlRX09JJE8Vvw==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"student1","provider":"local","displayName":"Student1 Local","pending":false,"created":{"$date":"2016-08-24T17:27:45.551Z"},"roles":["user","team member"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"UTKrxWHDiVtf23jRUSGktZ3YXmoPxoiB1v0VOKYy8bW5NdtzwPcOIMG6Gy71HevYy9+3gCn0RlLkMAsAfqaPlg==","email":"student1@localhost.com","lastName":"Local","firstName":"Student1","researchInterests":"

I want to learn.

","__v":0} {"_id":{"$oid":"57bdd911c0ff26078ba6350d"},"salt":"kt4HMNAuoQhGeGnSg762NQ==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"student2","provider":"local","displayName":"Student2 Local","pending":false,"created":{"$date":"2016-08-24T17:27:45.552Z"},"roles":["user","team member"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"PdxPK+mzJ4CPJjxb3s26zBst4oX2jn4/IuuQPOEa/khimJcoTBcs3oJMoxhdR3pgDmlzR6ZW6IKTt920qTdXoA==","email":"student2@localhost.com","lastName":"Local","firstName":"Student2","__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba63510"},"salt":"FEIsPW3s3PrAD0Iw2/tDrg==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"student3","provider":"local","displayName":"Student3 Local","pending":false,"created":{"$date":"2016-08-24T17:27:45.551Z"},"roles":["user","team member"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"Yfht5ucwrPqhgidxAQ/PeZe3y90Ha3trAbmEF9hdzjBQi1kkJ5SUGQcCH1WL0IGFGd7LElf6lQscXPdjQ8bWag==","email":"student3@localhost.com","lastName":"Local","firstName":"Student3","__v":0} +{"_id":{"$oid":"57bdd911c0ff26078ba63511"},"salt":"n94zy8zXRDL2Ld0Ifb/ECQ==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"student4","provider":"local","displayName":"Student4 Local","pending":false,"created":{"$date":"2016-08-24T17:27:45.552Z"},"roles":["user","team member"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"HMzFjuCWMI+tvmVd6odenzF7QJYREpeRK/4F/Joznahs9IKkrta12uyhKPD7iWFMcvMmnYKsebghwiFtaZEoSw==","email":"student4@localhost.com","lastName":"Local","firstName":"Student4","__v":0} {"_id":{"$oid":"57bdd911c0ff26078ba6350e"},"salt":"w9m+xiHzjHNNya9DTenXVw==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"siteCoordinator1","provider":"local","displayName":"Site1 Coordinator","teamLeadType":"site coordinator","pending":false,"created":{"$date":"2016-08-24T17:27:45.553Z"},"roles":["user","team lead"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"v6lldEFsg4cA14St6CY1tKb4vFb0rOdCzUMu4NWeSuExRH8YgEI7RhOVYYTfNG4FbEUb36Nasx5IBk4RcY3S6A==","email":"siteCoordinator1@localhost.com","lastName":"Coordinator","firstName":"Site1","__v":0} {"_id":{"$oid":"57bdd911c0ff26078ba6350f"},"salt":"2FV+Br94++obNamEFQnY0g==","schoolOrg":{"$oid":"57bdd911c0ff26078ba63509"},"username":"siteCoordinator2","provider":"local","displayName":"Site2 Coordinator","teamLeadType":"site coordinator","pending":false,"created":{"$date":"2016-08-24T17:27:45.554Z"},"roles":["user","team lead"],"socialProfiles":{"website":"","facebook":"","twitter":""},"profileImageURL":"modules/users/client/img/profile/avatar-gray.png","password":"gowR6O+JPlpoxi6v0ODaihjrTGoODq2grn48iR9jxF4xNVqV+pysi71ZVr/ADT6KG2VzA/O7Ef8T5MSC0PWj2g==","email":"siteCoordinator2@localhost.com","lastName":"Coordinator","firstName":"Site2","__v":0}