Skip to content

Commit

Permalink
fix cypress and unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Jul 7, 2023
1 parent 5e04151 commit 5cae08a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .cypress/integration/9_integrations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const moveToAvailableNginxIntegration = () => {
};

const moveToAddedIntegrations = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/integrations#/added`);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/integrations#/installed`);
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function AddedIntegrationsTable(props: AddedIntegrationsTableProps) {
setToast(`Error deleting ${name} or its assets`, 'danger');
})
.finally(() => {
window.location.hash = '#/added';
window.location.hash = '#/installed';
});
}

Expand Down
2 changes: 2 additions & 0 deletions public/components/integrations/components/integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ export function Integration(props: AvailableIntegrationProps) {
body: JSON.stringify({ name, dataSource }),
})
.then((_res) => {
console.log(_res);
setToast(
`${name} integration successfully added!`,
'success',
`View the added assets from ${name} in the Added Integrations list`
);
window.location.hash = `#/installed/${_res.data?.id}`;
return true;
})
.catch((_err) => {
Expand Down
4 changes: 2 additions & 2 deletions server/adaptors/integrations/integrations_kibana_backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export class IntegrationsKibanaBackend implements IntegrationsAdaptor {
name,
dataSource,
});
await this.client.create('integration-instance', result);
return Promise.resolve(result);
const test = await this.client.create('integration-instance', result);
return Promise.resolve({ ...result, id: test.id });
} catch (err: any) {
return Promise.reject({
message: err.message,
Expand Down

0 comments on commit 5cae08a

Please sign in to comment.