This repository has been archived by the owner on May 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
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
1 parent
f6f31c5
commit 9c569a7
Showing
4 changed files
with
30 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
up: (queryInterface) => { | ||
return queryInterface.removeColumn( | ||
'Users', | ||
'useSwipeReview', | ||
); | ||
|
||
}, | ||
|
||
down: (queryInterface, Sequelize) => { | ||
return queryInterface.addColumn( | ||
'Users', | ||
'useSwipeReview', | ||
{ | ||
type: Sequelize.BOOLEAN, | ||
defaultValue: false, | ||
}, | ||
); | ||
}, | ||
}; |
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ import users from '../../lib/users'; | |
const exampleUserRecord = { | ||
id: '1', | ||
email: '[email protected]', | ||
useSwipeReview: true, | ||
languages: '', | ||
}; | ||
|
||
|
@@ -31,16 +30,14 @@ test.serial('get: should get user', async (t) => { | |
t.deepEqual(user, { | ||
email: '[email protected]', | ||
languages: [], | ||
settings: { | ||
useSwipeReview: true, | ||
}, | ||
settings: {}, | ||
}); | ||
}); | ||
|
||
test.serial('updateSetting: should update user', async (t) => { | ||
await users.updateSetting('[email protected]', 'useSwipeReview', true); | ||
await users.updateSetting('[email protected]', 'foo', true); | ||
t.true(User.update.calledWith({ | ||
useSwipeReview: true, | ||
foo: true, | ||
}, { | ||
where: { | ||
email: '[email protected]', | ||
|