Skip to content

Commit

Permalink
Add Test for Vis Builder Bugs (#1340) (#1429)
Browse files Browse the repository at this point in the history
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
(cherry picked from commit 7f2c9b5)

Co-authored-by: Suchit Sahoo <38322563+LDrago27@users.noreply.github.com>
  • Loading branch information
opensearch-trigger-bot[bot] and LDrago27 authored Jun 21, 2024
1 parent 73505e1 commit c72a6a1
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 c72a6a1

Please sign in to comment.