Skip to content

Commit

Permalink
build: release
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza authored Apr 4, 2022
2 parents 7afcfce + 68e616e commit 62dc989
Show file tree
Hide file tree
Showing 6 changed files with 5,100 additions and 3,352 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-automated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Determine tag on current commit
id: tag
Expand Down
24 changes: 5 additions & 19 deletions integration/test/ParseUserTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const assert = require('assert');
const Parse = require('../../node');
const uuidv4 = require('uuid/v4');
const { twitterAuthData } = require('./helper');

class CustomUser extends Parse.User {
constructor(attributes) {
Expand Down Expand Up @@ -953,21 +954,13 @@ describe('Parse User', () => {

it('can link with twitter', async () => {
Parse.User.enableUnsafeCurrentUser();
const authData = {
id: 227463280,
consumer_key: '5QiVwxr8FQHbo5CMw46Z0jquF',
consumer_secret: 'p05FDlIRAnOtqJtjIt0xcw390jCcjj56QMdE9B52iVgOEb7LuK',
auth_token: '227463280-lngpMGXdnG36JiuzGfAYbKcZUPwjmcIV2NqL9hWc',
auth_token_secret: 'G1tl1R0gaYKTyxw0uYJDKRoVhM16ifyLeMwIaKlFtPkQr',
};
const user = new Parse.User();
user.setUsername(uuidv4());
user.setPassword(uuidv4());
await user.signUp();

await user.linkWith('twitter', { authData });

expect(user.get('authData').twitter.id).toBe(authData.id);
await user.linkWith('twitter', { authData: twitterAuthData });
expect(user.get('authData').twitter.id).toBe(twitterAuthData.id);
expect(user._isLinked('twitter')).toBe(true);

await user._unlinkFrom('twitter');
Expand All @@ -977,25 +970,18 @@ describe('Parse User', () => {
it('can link with twitter and facebook', async () => {
Parse.User.enableUnsafeCurrentUser();
Parse.FacebookUtils.init();
const authData = {
id: 227463280,
consumer_key: '5QiVwxr8FQHbo5CMw46Z0jquF',
consumer_secret: 'p05FDlIRAnOtqJtjIt0xcw390jCcjj56QMdE9B52iVgOEb7LuK',
auth_token: '227463280-lngpMGXdnG36JiuzGfAYbKcZUPwjmcIV2NqL9hWc',
auth_token_secret: 'G1tl1R0gaYKTyxw0uYJDKRoVhM16ifyLeMwIaKlFtPkQr',
};
const user = new Parse.User();
user.setUsername(uuidv4());
user.setPassword(uuidv4());
await user.signUp();

await user.linkWith('twitter', { authData });
await user.linkWith('twitter', { authData: twitterAuthData });
await Parse.FacebookUtils.link(user);

expect(Parse.FacebookUtils.isLinked(user)).toBe(true);
expect(user._isLinked('twitter')).toBe(true);

expect(user.get('authData').twitter.id).toBe(authData.id);
expect(user.get('authData').twitter.id).toBe(twitterAuthData.id);
expect(user.get('authData').facebook.id).toBe('test');
});

Expand Down
22 changes: 20 additions & 2 deletions integration/test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ const mountPath = '/parse';
const serverURL = 'http://localhost:1337/parse';
let didChangeConfiguration = false;

/*
To generate the auth data below, the Twitter app "GitHub CI Test App" has
been created, managed by the @ParsePlatform Twitter account. In case this
test starts to fail because the token has become invalid, generate a new
token according to the OAuth process described in the Twitter docs[1].
[1] https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens
*/
const twitterAuthData = {
id: '1506726799266430985',
consumer_key: 'jeQw6luN2PEWREtoFDb0FdGYf',
consumer_secret: 'VSFENh1X5UC4MLEuduHLtJDnf8Ydsh5KuSR4zZQufFCAGNtzcs',
auth_token: '1506726799266430985-NKM9tqVbPXMnLhHTLYB98SNGtxxi6v',
auth_token_secret: 'JpDVIINbqV5TK0th9nKiS1IVokZfjRj06FrXxCrkggF07',
};

const defaultConfiguration = {
databaseURI: 'mongodb://localhost:27017/integration',
appId: 'integration',
Expand All @@ -34,8 +50,8 @@ const defaultConfiguration = {
appIds: 'test',
},
twitter: {
consumer_key: '5QiVwxr8FQHbo5CMw46Z0jquF',
consumer_secret: 'p05FDlIRAnOtqJtjIt0xcw390jCcjj56QMdE9B52iVgOEb7LuK',
consumer_key: twitterAuthData.consumer_key,
consumer_secret: twitterAuthData.consumer_secret,
},
},
verbose: false,
Expand Down Expand Up @@ -144,3 +160,5 @@ afterEach(async () => {
await reconfigureServer();
}
});

module.exports = { twitterAuthData };
Loading

0 comments on commit 62dc989

Please sign in to comment.