Skip to content

Commit

Permalink
[TIP] Replace indicator field-selector EuiSelect by EuiComboBox (#140980
Browse files Browse the repository at this point in the history
)

[TIP] Replace indicator field-selector EuiSelect by EuiComboBox
  • Loading branch information
PhilippeOberti authored Sep 20, 2022
1 parent 6927902 commit e826b9c
Show file tree
Hide file tree
Showing 7 changed files with 385 additions and 181 deletions.
12 changes: 6 additions & 6 deletions x-pack/plugins/threat_intelligence/cypress/e2e/indicators.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import {
ENDING_BREADCRUMB,
FIELD_BROWSER,
FIELD_BROWSER_MODAL,
FIELD_SELECTOR_TOGGLE_BUTTON,
FIELD_SELECTOR_INPUT,
FIELD_SELECTOR_LIST,
} from '../screens/indicators';
import { login } from '../tasks/login';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
Expand Down Expand Up @@ -143,16 +146,13 @@ describe('Indicators', () => {

it('should have the default selected field, then update when user selects', () => {
const threatFeedName = 'threat.feed.name';
cy.get(`${FIELD_SELECTOR}`).should('have.value', threatFeedName);
cy.get(`${FIELD_SELECTOR_INPUT}`).eq(0).should('have.text', threatFeedName);

const threatIndicatorIp: string = 'threat.indicator.ip';

cy.get(`${FIELD_SELECTOR}`)
.should('exist')
.select(threatIndicatorIp)
.should('have.value', threatIndicatorIp);
cy.get(`${FIELD_SELECTOR_TOGGLE_BUTTON}`).should('exist').click();

cy.get(`${FIELD_SELECTOR}`).should('have.value', threatIndicatorIp);
cy.get(`${FIELD_SELECTOR_LIST}`).should('exist').contains(threatIndicatorIp);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export const INDICATOR_TYPE_CELL = '[data-gridcell-column-id="threat.indicator.t

export const FIELD_SELECTOR = '[data-test-subj="tiIndicatorFieldSelectorDropdown"]';

export const FIELD_SELECTOR_INPUT = '[data-test-subj="comboBoxInput"]';

export const FIELD_SELECTOR_TOGGLE_BUTTON = '[data-test-subj="comboBoxToggleListButton"]';

export const FIELD_SELECTOR_LIST = '[data-test-subj="comboBoxOptionsList"]';

export const FIELD_BROWSER = `[data-test-subj="show-field-browser"]`;

export const FIELD_BROWSER_MODAL = `[data-test-subj="fields-browser-container"]`;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e826b9c

Please sign in to comment.