Skip to content

Commit

Permalink
fix helper functions not being called
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Silva <[email protected]>
  • Loading branch information
silvaf-dev committed Jan 7, 2025
1 parent 2c3aaf5 commit 618a47f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ const checkFilteredFieldsForAllLanguages = (isIndexPattern = true) => {
sidebarFiltering.checkSidebarFilterBarResults(search, assertion);
});
};

// Check filtering results by query language
() => {
const checkFilteringResultsByQueryLanguage = () => {
if (isIndexPattern) {
fieldFiltering.selectIndexPatternDataset(INDEX_PATTERN_NAME, 'DQL');
INDEX_PATTERN_LANGUAGES.slice(0, 2).forEach((lang) => {
Expand All @@ -177,6 +175,7 @@ const checkFilteredFieldsForAllLanguages = (isIndexPattern = true) => {
checkSidebarFilterSearchResults();
});
}
checkFilteringResultsByQueryLanguage();
};

const checkSidebarPanelCollapseAndExpandBehavior = (isIndexPattern = true) => {
Expand All @@ -189,8 +188,7 @@ const checkSidebarPanelCollapseAndExpandBehavior = (isIndexPattern = true) => {
sidebarFiltering.clickSidebarCollapseBtn(false);
cy.getElementByTestId('sidebarPanel').should('be.visible');
};
// Collapse and expand
() => {
const collapseAndExpandByLanguage = () => {
if (isIndexPattern) {
fieldFiltering.selectIndexPatternDataset(INDEX_PATTERN_NAME, 'DQL');
INDEX_PATTERN_LANGUAGES.slice(0, 2).forEach((lang) => {
Expand All @@ -210,11 +208,12 @@ const checkSidebarPanelCollapseAndExpandBehavior = (isIndexPattern = true) => {
cy.getElementByTestId('sidebarPanel').should('be.visible');
}
}
collapseAndExpandByLanguage();
};

const checkSidebarPanelCollapsedState = (isIndexPattern = true) => {
// Check state by language, according to data type
() => {
const checkStateByLanguage = () => {
if (isIndexPattern) {
fieldFiltering.selectIndexPatternDataset(INDEX_PATTERN_NAME, 'DQL');
sidebarFiltering.clickSidebarCollapseBtn();
Expand All @@ -237,6 +236,7 @@ const checkSidebarPanelCollapsedState = (isIndexPattern = true) => {
cy.getElementByTestId('sidebarPanel').should('not.be.visible');
}
};
checkStateByLanguage();
// Clean state for the next test
sidebarFiltering.clickSidebarCollapseBtn(false);
};
Expand Down

0 comments on commit 618a47f

Please sign in to comment.