mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Move api tests to v2 namespace
This commit is contained in:
26
test/api/v2/user/pushDevice/POST-pushDevice.test.js
Normal file
26
test/api/v2/user/pushDevice/POST-pushDevice.test.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /user/pushDevice', () => {
|
||||
let api;
|
||||
|
||||
beforeEach(() => {
|
||||
return generateUser().then((user) => {
|
||||
api = requester(user);
|
||||
});
|
||||
});
|
||||
|
||||
it('registers a device id', () => {
|
||||
return api.post('/user/pushDevice', {
|
||||
regId: '123123',
|
||||
type: 'android',
|
||||
}).then((devices) => {
|
||||
let device = devices[0];
|
||||
expect(device._id).to.exist;
|
||||
expect(device.regId).to.eql('123123');
|
||||
expect(device.type).to.eql('android');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user