Skip to content

Commit

Permalink
fix cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Apr 30, 2024
1 parent 682cb39 commit 4b50cfa
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions x-pack/plugins/fleet/cypress/e2e/privileges_editor_role.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { login, loginWithUserAndWaitForPage, logout } from '../tasks/login';

import { getIntegrationCard } from '../screens/integrations';

import { LANDING_PAGE_ADD_FLEET_SERVER_BUTTON } from '../screens/fleet';
import { ADD_AGENT_BUTTON, FLEET_SERVER_MISSING_PRIVILEGES } from '../screens/fleet';
import { ADD_INTEGRATION_POLICY_BTN } from '../screens/integrations';
import { scrollToIntegration } from '../tasks/integrations';

Expand Down Expand Up @@ -40,9 +40,30 @@ describe('When the user has Editor built-in role', () => {
navigateTo(FLEET);
});

it('It should not show a callout', () => {
it('It should not show a callout if fleet server is setup', () => {
cy.intercept('GET', '/api/fleet/agents/setup', {
body: {
isReady: true,
is_secrets_storage_enabled: true,
missing_requirements: [],
missing_optional_features: [],
},
});
loginWithUserAndWaitForPage(FLEET, BuiltInEditorUser);
cy.getBySel(LANDING_PAGE_ADD_FLEET_SERVER_BUTTON).should('exist');
cy.getBySel(ADD_AGENT_BUTTON).should('exist');
});

it('It should not show a callout with missing manage_service_accout if fleet server is not setup', () => {
cy.intercept('GET', '/api/fleet/agents/setup', {
body: {
isReady: true,
is_secrets_storage_enabled: true,
missing_requirements: ['fleet_server'],
missing_optional_features: [],
},
});
loginWithUserAndWaitForPage(FLEET, BuiltInEditorUser);
cy.getBySel(FLEET_SERVER_MISSING_PRIVILEGES.PROMPT).should('exist');
});
});

Expand Down

0 comments on commit 4b50cfa

Please sign in to comment.