-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create methods for profile migration consent feature
- Loading branch information
1 parent
aed8b74
commit 93dacb0
Showing
3 changed files
with
145 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -158,3 +158,44 @@ describe('User - delete', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('User - update profile migration consent', () => { | ||
beforeAll(async () => { | ||
account = getAccount(3); | ||
|
||
// The Safe must be deployed and signedup to the Hub before trying to change the consent | ||
deployedSafe = await deploySafeAndToken(core, account); | ||
safeAddress = deployedSafe.safeAddress; | ||
username = `catty${new Date().getTime()}`; | ||
email = '[email protected]'; | ||
|
||
// This update acts as a register | ||
await core.user.update(account, { | ||
email, | ||
safeAddress, | ||
username, | ||
}); | ||
}); | ||
|
||
describe('when a new user registers its Safe address', () => { | ||
it('should return profile migration consent', async () => { | ||
expect( | ||
await core.user.getProfileMigrationConsent(account, { | ||
safeAddress, | ||
}), | ||
).toBe(false); | ||
}); | ||
|
||
it('should return correct value of profile migration consent after updatins', async () => { | ||
await core.user.updateProfileMigrationConsent(account, { | ||
safeAddress, | ||
profileMigrationConsent: true, | ||
}), | ||
expect( | ||
await core.user.getProfileMigrationConsent(account, { | ||
safeAddress, | ||
}), | ||
).toBe(true); | ||
}); | ||
}); | ||
}); |