fleet/frontend/test/mocks/invite_mocks.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

import createRequestMock from "test/mocks/create_request_mock";
export default {
create: {
valid: (bearerToken, params) => {
return createRequestMock({
bearerToken,
endpoint: "/api/v1/fleet/invites",
method: "post",
params,
response: { invite: params },
});
},
},
loadAll: {
valid: (bearerToken) => {
return createRequestMock({
bearerToken,
2021-04-14 16:52:15 +00:00
endpoint: "/api/v1/fleet/invites?page=0&per_page=100",
method: "get",
implement user table with new table and hook up create and edit and delete users (#587) * hook up user and invite data together for data table * added client derived data to user table * hooked up action dropdown to table * hooked up edit modal and password reset * started adding editing user functiaonlity * add query params to /invite call * clean up editing teams * update select team from to handle existing users with teams * update closes modal now * reuse getUser to clean up code in userManagementpage * pass form data to updating user that is not the current User * add dynamic userform submit text and fix tests * fix lint error in table component * added empty state for user table * clean up unused data table props * added delete modal * add delete user functionality * add delete option for invite * Add styles for rows in user table and action dropdown cell * hook up user and invite data together for data table * added client derived data to user table * hooked up action dropdown to table * hooked up edit modal and password reset * started adding editing user functiaonlity * add query params to /invite call * clean up editing teams * update select team from to handle existing users with teams * update closes modal now * reuse getUser to clean up code in userManagementpage * pass form data to updating user that is not the current User * add dynamic userform submit text and fix tests * fix lint error in table component * added empty state for user table * clean up unused data table props * added delete modal * add delete user functionality * add delete option for invite * Merge in generateClassTag * Refactor table styles * Add newline to DropdownCell style sheet Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com> * update checking for admin through global_role in nav * added defaultGloablRole for creat user modal * remove unused comment * fix broken tests * reenabled search for users tests Co-authored-by: noahtalerman <47070608+noahtalerman@users.noreply.github.com>
2021-04-09 10:44:57 +00:00
response: { invites: [] },
});
},
validWithParams: (bearerToken) => {
return createRequestMock({
bearerToken,
2021-04-14 16:52:15 +00:00
endpoint:
"/api/v1/fleet/invites?page=3&per_page=100&&order_key=name&order_direction=desc&query=testQuery",
method: "get",
response: { invites: [] },
});
},
},
destroy: {
valid: (bearerToken, invite) => {
return createRequestMock({
bearerToken,
endpoint: `/api/v1/fleet/invites/${invite.id}`,
method: "delete",
response: {},
});
},
},
};