Skip to content

Commit

Permalink
rename 2 tests to use should... convention
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeOberti committed Jan 11, 2024
1 parent 2c76383 commit 8e9520f
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('Fields Browser', { tags: ['@ess', '@serverless'] }, () => {
});

describe('Fields Browser rendering', () => {
it('displays the expected count of categories and fields that match the filter input', () => {
it('should display the expected count of categories and fields that match the filter input', () => {
const filterInput = 'host.mac';

filterFieldsBrowser(filterInput);
Expand All @@ -64,7 +64,7 @@ describe('Fields Browser', { tags: ['@ess', '@serverless'] }, () => {
cy.get(FIELDS_BROWSER_FIELDS_COUNT).should('contain.text', '2');
});

it('displays only the selected fields when "view selected" option is enabled', () => {
it('should display only the selected fields when "view selected" option is enabled', () => {
activateViewSelected();
cy.get(FIELDS_BROWSER_FIELDS_COUNT).should('contain.text', `${defaultHeaders.length}`);
defaultHeaders.forEach((header) => {
Expand All @@ -77,16 +77,22 @@ describe('Fields Browser', { tags: ['@ess', '@serverless'] }, () => {
const categoryCheck = 'event';

cy.get(FIELDS_BROWSER_CATEGORY_BADGE(category)).should('not.exist');

toggleCategory(category);

cy.get(FIELDS_BROWSER_CATEGORY_BADGE(category)).should('exist');

toggleCategory(category);

cy.log('the category filter should contain the filtered category');

filterFieldsBrowser(category);
toggleCategoryFilter();

cy.get(FIELDS_BROWSER_CATEGORIES_FILTER_CONTAINER).should('contain.text', category);

cy.log('non-matching categories should not be listed in the category filter');

cy.get(FIELDS_BROWSER_CATEGORIES_FILTER_CONTAINER).should('not.contain.text', categoryCheck);
});
});
Expand All @@ -96,17 +102,23 @@ describe('Fields Browser', { tags: ['@ess', '@serverless'] }, () => {
const filterInput = 'host.geo.c';

cy.log('removing the message column');

cy.get(FIELDS_BROWSER_MESSAGE_HEADER).should('exist');

removesMessageField();
closeFieldsBrowser();

cy.get(FIELDS_BROWSER_MESSAGE_HEADER).should('not.exist');

cy.log('add host.geo.city_name column');

cy.get(FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER).should('not.exist');

openTimelineFieldsBrowser();
filterFieldsBrowser(filterInput);
addsHostGeoCityNameToTimeline();
closeFieldsBrowser();

cy.get(FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER).should('exist');
});

Expand All @@ -128,10 +140,13 @@ describe('Fields Browser', { tags: ['@ess', '@serverless'] }, () => {
cy.get(FIELDS_BROWSER_HEADER_HOST_GEO_CONTINENT_NAME_HEADER).should('not.exist');

cy.log('restores focus to the Customize Columns button when `Reset Fields` is clicked');

cy.get(TIMELINE_FIELDS_BUTTON).should('have.focus');

cy.log('restores focus to the Customize Columns button when Esc is pressed');

openTimelineFieldsBrowser();

cy.get(FIELDS_BROWSER_FILTER_INPUT).type('{esc}');
cy.get(TIMELINE_FIELDS_BUTTON).should('have.focus');
});
Expand Down

0 comments on commit 8e9520f

Please sign in to comment.