Skip to content

Commit 10155a1

Browse files
committed
Fixes problematic test
1 parent 55528a6 commit 10155a1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spec/ParseUser.spec.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,17 +1178,19 @@ describe('Parse.User testing', () => {
11781178
return user._linkWith('facebook', {});
11791179
}).then(user => {
11801180
expect(user._isLinked("facebook")).toBeTruthy();
1181-
return Parse.User._logInWith('facebook', {});
1181+
// We should logout here as session token is passed
1182+
// Probably need a fix in the JS SDK to handle those
1183+
// linking errors
1184+
return Parse.User.logOut().then(() => {
1185+
return Parse.User._logInWith('facebook', {});
1186+
});
11821187
}).then(user => {
11831188
const fileAgain = user.get('file');
11841189
expect(fileAgain.name()).toMatch(/yolo.txt$/);
11851190
expect(fileAgain.url()).toMatch(/yolo.txt$/);
11861191
}).then(() => {
11871192
done();
1188-
}, error => {
1189-
jfail(error);
1190-
done();
1191-
});
1193+
}).catch(done.fail);
11921194
});
11931195

11941196
it("log in with provider twice", (done) => {

0 commit comments

Comments
 (0)