forked from parse-community/Parse-SDK-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParseInstallation-test.js
28 lines (23 loc) · 971 Bytes
/
ParseInstallation-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
jest.dontMock('../CoreManager');
jest.dontMock('../decode');
jest.dontMock('../ObjectStateMutations');
jest.dontMock('../ParseError');
jest.dontMock('../ParseObject');
jest.dontMock('../ParseOp');
jest.dontMock('../ParseInstallation');
jest.dontMock('../SingleInstanceStateController');
jest.dontMock('../UniqueInstanceStateController');
const ParseInstallation = require('../ParseInstallation').default;
describe('ParseInstallation', () => {
it('can create ParseInstallation', () => {
let installation = new ParseInstallation();
expect(installation.className).toBe('_Installation');
installation = new ParseInstallation({});
expect(installation.className).toBe('_Installation');
installation = new ParseInstallation({ deviceToken: 'token' });
expect(installation.get('deviceToken')).toBe('token');
expect(() => {
new ParseInstallation({ 'invalid#name': 'foo' });
}).toThrow("Can't create an invalid Installation");
});
});