fleet/frontend/test/mocks/session_mocks.js
Martavis Parker a8d7b5478b
Updated API routes to use current format for frontend use (#5018)
* removed global api routes; using 'latest' instead of v1 for api routes

* lint fixes

* updated docs and tests

* lint fixes

* route fix

* fixed routes breaking packs queries

* revert test change
2022-04-11 13:04:38 -07:00

25 lines
594 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/latest/fleet/login",
method: "post",
params,
response: { token: bearerToken, user: userStub },
});
},
},
destroy: {
valid: (bearerToken) => {
return createRequestMock({
bearerToken,
endpoint: "/api/latest/fleet/logout",
method: "post",
response: {},
});
},
},
};