Skip to content

Commit

Permalink
Fix cypress 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 Apr 26, 2024
1 parent a93b7dc commit 3be7bb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
8 changes: 4 additions & 4 deletions public/apps/configuration/utils/tenant-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ export async function updateTenancyConfiguration(
updatedTenancyConfig: TenancyConfigSettings
) {
// Tenancy locked to local cluster
await createLocalClusterRequestContext().httpPut(
await createLocalClusterRequestContext().httpPut({

Check warning on line 127 in public/apps/configuration/utils/tenant-utils.tsx

View check run for this annotation

Codecov / codecov/patch

public/apps/configuration/utils/tenant-utils.tsx#L127

Added line #L127 was not covered by tests
http,
API_ENDPOINT_TENANCY_CONFIGS,
updatedTenancyConfig
);
url: API_ENDPOINT_TENANCY_CONFIGS,
body: updatedTenancyConfig,
});
return;
}

Expand Down
2 changes: 0 additions & 2 deletions public/apps/configuration/utils/test/request-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,4 @@ describe('RequestContext', () => {
const context = requestUtils.createLocalClusterRequestContext();
expect(context.query).toEqual({ dataSourceId: '' });
});

// You can write similar tests for other methods like httpPost, httpPut, httpDelete, etc.
});
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ describe('Multi-datasources enabled', () => {
);

cy.contains('h1', 'Get started');
cy.get('[data-test-subj="dataSourceSelectableContextMenuHeaderLink"]').should(
'contain',
'9202'
);
cy.get('[data-test-subj="dataSourceSelectableButton"]').should('contain', '9202');

cy.get('[data-test-subj="purge-cache"]').click();
cy.get('[class="euiToast euiToast--success euiGlobalToastListItem"]')
Expand Down Expand Up @@ -233,10 +230,7 @@ describe('Multi-datasources enabled', () => {
`http://localhost:5601/app/security-dashboards-plugin${externalDataSourceUrl}#/roles`
);

cy.get('[data-test-subj="dataSourceSelectableContextMenuHeaderLink"]').should(
'contain',
'9202'
);
cy.get('[data-test-subj="dataSourceSelectableButton"]').should('contain', '9202');
cy.get('[data-test-subj="tableHeaderCell_roleName_0"]').click();
cy.get('[data-test-subj="checkboxSelectRow-9202-role"]').should('exist');

Expand Down

0 comments on commit 3be7bb5

Please sign in to comment.