-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,7 +229,8 @@ describe('database/actions.js', () => { | |
|
||
describe('exported functions', () => { | ||
const id = 2; | ||
const m = Immutable.fromJS({ | ||
const hookRunner = jest.fn((str, m, context, fn) => fn()); | ||
Check notice Code scanning / CodeQL Unused variable, import, function or class Note test
Unused variable hookRunner.
|
||
const mCaptcha = Immutable.fromJS({ | ||
field: { | ||
email: { | ||
value: '[email protected]' | ||
|
@@ -266,35 +267,41 @@ describe('database/actions.js', () => { | |
{ name: 'other_prop' } | ||
] | ||
}, | ||
captcha: { | ||
provider: 'auth0' | ||
}, | ||
passwordResetCaptcha: { | ||
provider: 'auth0' | ||
}, | ||
}); | ||
|
||
describe('resetPasswordSuccess', () => { | ||
it('runs swap CAPTCHA', () => { | ||
swap(setEntity, 'lock', id, m); | ||
swap(setEntity, 'lock', id, mCaptcha); | ||
resetPasswordSuccess(id); | ||
expect(swapCaptcha.mock.calls.length).toEqual(1); | ||
}); | ||
}); | ||
|
||
describe('showResetPasswordActivity', () => { | ||
it('runs swap CAPTCHA', () => { | ||
swap(setEntity, 'lock', id, m); | ||
swap(setEntity, 'lock', id, mCaptcha); | ||
showResetPasswordActivity(id); | ||
expect(swapCaptcha.mock.calls.length).toEqual(1); | ||
}); | ||
}); | ||
|
||
describe('showLoginActivity', () => { | ||
it('runs swap CAPTCHA', () => { | ||
swap(setEntity, 'lock', id, m); | ||
swap(setEntity, 'lock', id, mCaptcha); | ||
showLoginActivity(id); | ||
expect(swapCaptcha.mock.calls.length).toEqual(1); | ||
}); | ||
}); | ||
|
||
describe('showSignupActivity', () => { | ||
it('runs swap CAPTCHA', () => { | ||
swap(setEntity, 'lock', id, m); | ||
swap(setEntity, 'lock', id, mCaptcha); | ||
showSignUpActivity(id); | ||
expect(swapCaptcha.mock.calls.length).toEqual(1); | ||
}); | ||
|
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