-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: consolidate the login code to the session store
- Loading branch information
Showing
8 changed files
with
60 additions
and
57 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
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
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 |
---|---|---|
|
@@ -96,23 +96,23 @@ describe('Testing User and CourseUsers', () => { | |
describe('Testing for valid and invalid users.', () => { | ||
|
||
test('setting invalid email', () => { | ||
const user = new User({ username: 'test' }); | ||
const user = new User({ username: 'test', user_id: 10, is_admin: true }); | ||
expect(user.isValid()).toBe(true); | ||
|
||
user.email = 'bad@[email protected]'; | ||
expect(user.isValid()).toBe(false); | ||
}); | ||
|
||
test('setting invalid user_id', () => { | ||
const user = new User({ username: 'test' }); | ||
const user = new User({ username: 'test', user_id: 10, is_admin: true }); | ||
expect(user.isValid()).toBe(true); | ||
|
||
user.user_id = -15; | ||
expect(user.isValid()).toBe(false); | ||
}); | ||
|
||
test('setting invalid username', () => { | ||
const user = new User({ username: 'my username' }); | ||
const user = new User({ username: 'my username', user_id: 10, is_admin: true }); | ||
expect(user.isValid()).toBe(false); | ||
}); | ||
}); | ||
|