-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from classroom-interaction-environment/feature…
…-groups feature: group mode
- Loading branch information
Showing
97 changed files
with
3,311 additions
and
1,233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
METEOR@2.7.3 | ||
METEOR@2.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/imports/api/accounts/registration/tests/getEnrollmentExpiration.tests.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-env mocha */ | ||
import { expect } from 'chai' | ||
import { Meteor } from 'meteor/meteor' | ||
import { getEnrollmentExpiration } from '../getEnrollmentExpiration' | ||
|
||
const { passwordEnrollTokenExpirationInDays } = Meteor.settings.accounts.config | ||
|
||
describe(getEnrollmentExpiration.name, function () { | ||
it('returns the given expiration of days in ms from given date', () => { | ||
const now = new Date() | ||
const expires = getEnrollmentExpiration(now) | ||
const diff = expires - now.getTime() | ||
expect(diff / 86400000).to.equal(passwordEnrollTokenExpirationInDays) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { getUsersCollection } from '../../utils/getUsersCollection' | ||
|
||
export const getUserByEmail = email => { | ||
return getUsersCollection().findOne({ emails: { address: email } }) | ||
return getUsersCollection().findOne({ emails: { $elemMatch: { address: email } } }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Ensures that a property exists on a given object | ||
* @param target {object} | ||
* @param name {string} | ||
* @param factory {function|*} | ||
* @return {object} | ||
* @throws {Error} if target is not an object | ||
*/ | ||
export const withProperty = (target, name, factory) => { | ||
const type = typeof target | ||
if (type !== 'object') { | ||
throw new Error(`Expected object, get ${type}`) | ||
} | ||
|
||
if (name in target) { | ||
return target | ||
} | ||
|
||
if (typeof factory === 'function') { | ||
return factory(target, name) | ||
} | ||
else { | ||
const descriptor = Object.create(null) | ||
descriptor.value = factory | ||
descriptor.enumerable = true | ||
descriptor.writable = true | ||
descriptor.configurable = true | ||
Object.defineProperty(target, name, descriptor) | ||
} | ||
|
||
return target | ||
} |
Oops, something went wrong.