Skip to content

Commit

Permalink
Add Test for Vis Builder Bugs (#1340)
Browse files Browse the repository at this point in the history
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
  • Loading branch information
LDrago27 authored Jun 3, 2024
1 parent 34415b3 commit 7f2c9b5
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,47 @@ if (Cypress.env('VISBUILDER_ENABLED')) {
cy.deleteSavedObjectByType(VB_SO_TYPE, `vb${cleanupKey}`);
});

it('Check toggle legend functionality', () => {
// Settting up the page
cy.visit(VB_APP_URL);

// Wait for page to load
cy.waitForLoader();
cy.vbSelectDataSource(VB_INDEX_PATTERN);

cy.getElementByTestId('field-undefined-showDetails').drag(
'[data-test-subj=dropBoxAddField-metric]'
);

// default behaviour: hidden
cy.getElementByTestId('legend-Count').should('be.visible');
cy.getElementByTestId('vislibToggleLegend').click();

cy.getElementByTestId('legend-Count').should('not.exist');
cy.getElementByTestId('vislibToggleLegend').click();

cy.getElementByTestId('legend-Count').should('be.visible');
});

it('Check dragging a field out of bounds does not scroll the pane', () => {
// Settting up the page
cy.visit(VB_APP_URL);

// Wait for page to load
cy.waitForLoader();
cy.vbSelectDataSource(VB_INDEX_PATTERN);

cy.getElementByTestId('field-undefined-showDetails').drag(
'[data-test-subj=dropBoxAddField-metric]'
);

cy.getElementByTestId('dropBoxField-metric-0').drag(
'[data-test-subj="vbOption-Settings"]'
);

cy.get('[class="vbConfig__title"]').contains('Configuration');
});

after(() => {
cy.deleteIndex(VB_INDEX_ID);
});
Expand Down

0 comments on commit 7f2c9b5

Please sign in to comment.