Skip to content

Commit

Permalink
fix: defaultTenant does not take effect (#1318)
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe authored May 10, 2024
1 parent 179ca7a commit d9460de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 11 additions & 0 deletions cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,3 +587,14 @@ Cypress.Commands.add('loadSampleData', (type) => {
url: `${BASE_PATH}/api/sample_data/${type}`,
});
});

Cypress.Commands.add('fleshTenantSettings', () => {
if (Cypress.env('SECURITY_ENABLED')) {
// Use xhr request is good enough to flesh tenant
cy.request({
url: `${BASE_PATH}/app/home?security_tenant=${CURRENT_TENANT.defaultTenant}`,
method: 'GET',
failOnStatusCode: false,
});
}
});
13 changes: 0 additions & 13 deletions cypress/utils/dashboards/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import './vis_builder/commands';
import './vis_type_table/commands';
import './vis-augmenter/commands';
import './data_explorer/commands';
import { BASE_PATH } from '../base_constants';
import { CURRENT_TENANT } from '../commands';

Cypress.Commands.add('waitForLoader', () => {
const opts = { log: false };
Expand Down Expand Up @@ -119,14 +117,3 @@ Cypress.Commands.add('setTopNavDate', (start, end, submit = true) => {
Cypress.Commands.add('updateTopNav', (options) => {
cy.getElementByTestId('querySubmitButton', options).click({ force: true });
});

Cypress.Commands.add('fleshTenantSettings', () => {
if (Cypress.env('SECURITY_ENABLED')) {
// Use xhr request is good enough to flesh tenant
cy.request({
url: `${BASE_PATH}/app/home?security_tenant=${CURRENT_TENANT.defaultTenant}`,
method: 'GET',
failOnStatusCode: false,
});
}
});

0 comments on commit d9460de

Please sign in to comment.