Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse committed Apr 26, 2023
1 parent 75d6151 commit 4aa1e3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ describe('ConvertConnectorApilogic', () => {
describe('convertConnector', () => {
it('calls correct api', async () => {
const promise = Promise.resolve('result');
http.post.mockReturnValue(promise);
http.put.mockReturnValue(promise);
const result = convertConnector({ connectorId: 'connectorId1' });
await nextTick();
expect(http.post).toHaveBeenCalledWith(
expect(http.put).toHaveBeenCalledWith(
'/internal/enterprise_search/connectors/connectorId1/native',
{ body: JSON.stringify({ is_native: true }) }
{ body: JSON.stringify({ is_native: false }) }
);
await expect(result).resolves.toEqual('result');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ export const convertConnector = async ({
}: ConvertConnectorApiLogicArgs): Promise<ConvertConnectorApiLogicResponse> => {
const route = `/internal/enterprise_search/connectors/${connectorId}/native`;

const result = await HttpLogic.values.http.put<{ updated: boolean }>(route, {
return await HttpLogic.values.http.put<{ updated: boolean }>(route, {
body: JSON.stringify({ is_native: false }),
});
return result;
};

export const ConvertConnectorApiLogic = createApiLogic(
Expand Down

0 comments on commit 4aa1e3e

Please sign in to comment.