From 8327a55c7510f9d3b456a4439237e6274b6e564a Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Thu, 14 Nov 2019 13:35:17 -0600 Subject: [PATCH] Fix #992 Revert https://github.com/parse-community/Parse-SDK-JS/pull/978 --- integration/test/ParseUserTest.js | 31 ++++++++++++++++--------------- src/ParseUser.js | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/integration/test/ParseUserTest.js b/integration/test/ParseUserTest.js index 34240f88e..5b4a823b0 100644 --- a/integration/test/ParseUserTest.js +++ b/integration/test/ParseUserTest.js @@ -630,21 +630,22 @@ describe('Parse User', () => { expect(user.get('foo')).toBe('bar'); }); - it('can get current with subclass', async () => { - Parse.User.enableUnsafeCurrentUser(); - - const customUser = new CustomUser({ foo: 'bar' }); - customUser.setUsername('username'); - customUser.setPassword('password'); - - await customUser.signUp(); - Parse.User._clearCache(); - - const user = CustomUser.current(); - expect(user instanceof CustomUser).toBe(true); - expect(user.doSomething()).toBe(5); - expect(user.get('foo')).toBe('bar'); - }); + // TODO: @dplewis + // it('can get current with subclass', async () => { + // Parse.User.enableUnsafeCurrentUser(); + + // const customUser = new CustomUser({ foo: 'bar' }); + // customUser.setUsername('username'); + // customUser.setPassword('password'); + + // await customUser.signUp(); + // Parse.User._clearCache(); + + // const user = CustomUser.current(); + // expect(user instanceof CustomUser).toBe(true); + // expect(user.doSomething()).toBe(5); + // expect(user.get('foo')).toBe('bar'); + // }); it('can logIn user with subclass', async () => { Parse.User.enableUnsafeCurrentUser(); diff --git a/src/ParseUser.js b/src/ParseUser.js index 64428ab15..3a4e318a1 100644 --- a/src/ParseUser.js +++ b/src/ParseUser.js @@ -869,7 +869,7 @@ const DefaultController = { updateUserOnDisk(user) { const path = Storage.generatePath(CURRENT_USER_KEY); const json = user.toJSON(); - json.className = user.constructor.name === 'ParseUser' ? '_User' : user.constructor.name; + json.className = '_User'; return Storage.setItemAsync( path, JSON.stringify(json) ).then(() => {