-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix gitcoin adapter to resubmit passport score
- Loading branch information
Showing
5 changed files
with
7 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,6 @@ function refreshUserScoresTestCases() { | |
const user = await User.create(userData).save(); | ||
await getGitcoinAdapter().submitPassport({ | ||
address: userData.walletAddress, | ||
scorer: '200', | ||
signature: 'any', | ||
nonce: 'any', | ||
}); | ||
const result = await axios.post(graphqlUrl, { | ||
query: refreshUserScores, | ||
|
@@ -74,9 +71,6 @@ function refreshUserScoresTestCases() { | |
const user = await User.create(userData).save(); | ||
await getGitcoinAdapter().submitPassport({ | ||
address: userData.walletAddress, | ||
scorer: '200', | ||
signature: 'any', | ||
nonce: 'any', | ||
}); | ||
const result = await axios.post(graphqlUrl, { | ||
query: refreshUserScores, | ||
|
@@ -102,30 +96,6 @@ function refreshUserScoresTestCases() { | |
updatedUser.passportScore, | ||
); | ||
}); | ||
it('should not refresh user scores if not registered to gitcoin', async () => { | ||
const userData = { | ||
firstName: 'firstName', | ||
lastName: 'lastName', | ||
email: '[email protected]', | ||
avatar: 'pinata address', | ||
url: 'website url', | ||
loginType: 'wallet', | ||
walletAddress: generateRandomEtheriumAddress(), | ||
}; | ||
const user = await User.create(userData).save(); | ||
const result = await axios.post(graphqlUrl, { | ||
query: refreshUserScores, | ||
variables: { | ||
address: userData.walletAddress, | ||
}, | ||
}); | ||
|
||
const updatedUser = result.data.data.refreshUserScores; | ||
assert.equal(updatedUser.walletAddress, user.walletAddress); | ||
// if score remains null the user has not registered | ||
assert.equal(updatedUser.passportScore, 0); | ||
assert.equal(updatedUser.passportStamps, 0); | ||
}); | ||
} | ||
|
||
function userByAddressTestCases() { | ||
|
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