fleet/frontend/test/mocks/session_mocks.js
Zach Wasserman 7a68e3de65
Deprecate /api/v1/kolide routes (#297)
- Support both /api/v1/fleet and /api/v1/kolide routes in server.
- Add logging for use of deprecated routes.
- Rename routes in frontend JS.
- Rename routes and add notes in documentation.
2021-02-10 12:13:11 -08:00

26 lines
586 B
JavaScript

import createRequestMock from 'test/mocks/create_request_mock';
import { userStub } from 'test/stubs';
export default {
create: {
valid: (bearerToken = 'abc123', params) => {
return createRequestMock({
endpoint: '/api/v1/fleet/login',
method: 'post',
params,
response: { token: bearerToken, user: userStub },
});
},
},
destroy: {
valid: (bearerToken) => {
return createRequestMock({
bearerToken,
endpoint: '/api/v1/fleet/logout',
method: 'post',
response: {},
});
},
},
};