From e286d9f02f7e86143a3ca54e82cbccefd6f91582 Mon Sep 17 00:00:00 2001 From: Ritesh Soni Date: Mon, 4 Oct 2021 20:09:47 +0530 Subject: [PATCH] Added tests for view/collapse, #3427 * added four tests (collapse.spec.js,collapse_all.spec.js,collapse_left.spec.js,collapse_right.spec.js) to check if the column's label are empty when collapsed --- .../grid/all-column/collapse_all.spec.js | 17 +++++++++++++++++ .../project/grid/column/view/collapse.spec.js | 14 ++++++++++++++ .../grid/column/view/collapse_left.spec.js | 16 ++++++++++++++++ .../grid/column/view/collapse_right.spec.js | 16 ++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 main/tests/cypress/cypress/integration/project/grid/all-column/collapse_all.spec.js create mode 100644 main/tests/cypress/cypress/integration/project/grid/column/view/collapse.spec.js create mode 100644 main/tests/cypress/cypress/integration/project/grid/column/view/collapse_left.spec.js create mode 100644 main/tests/cypress/cypress/integration/project/grid/column/view/collapse_right.spec.js diff --git a/main/tests/cypress/cypress/integration/project/grid/all-column/collapse_all.spec.js b/main/tests/cypress/cypress/integration/project/grid/all-column/collapse_all.spec.js new file mode 100644 index 000000000..85810eb09 --- /dev/null +++ b/main/tests/cypress/cypress/integration/project/grid/all-column/collapse_all.spec.js @@ -0,0 +1,17 @@ +describe(__filename, function () { +const fixture = [ + ['a', 'b', 'c'], + + ['0a', '0b', '0c'], + ['1a', '1b', '1c'] + ]; + it('it collapses all columns', function () { + cy.loadAndVisitProject(fixture); + cy.columnActionClick('All', ['View', 'Collapse all columns']); + + cy.get('[title="a"]').should('to.contain', ''); + cy.get('[title="b"]').should('to.contain', ''); + cy.get('[title="c"]').should('to.contain', ''); + + }); +}); diff --git a/main/tests/cypress/cypress/integration/project/grid/column/view/collapse.spec.js b/main/tests/cypress/cypress/integration/project/grid/column/view/collapse.spec.js new file mode 100644 index 000000000..06660ab3c --- /dev/null +++ b/main/tests/cypress/cypress/integration/project/grid/column/view/collapse.spec.js @@ -0,0 +1,14 @@ +describe(__filename, function () { + const fixture = [ + ['a', 'b', 'c'], + + ['0a', '0b', '0c'], + ['1a', '1b', '1c'] + ]; + it('it collapses all columns', function () { + cy.loadAndVisitProject(fixture); + cy.columnActionClick('a', ['View', 'Collapse this column']); + + cy.get('[title="a"]').should('to.contain', ''); + }); +}); diff --git a/main/tests/cypress/cypress/integration/project/grid/column/view/collapse_left.spec.js b/main/tests/cypress/cypress/integration/project/grid/column/view/collapse_left.spec.js new file mode 100644 index 000000000..b01b11c6e --- /dev/null +++ b/main/tests/cypress/cypress/integration/project/grid/column/view/collapse_left.spec.js @@ -0,0 +1,16 @@ +describe(__filename, function () { +const fixture = [ + ['a', 'b', 'c'], + + ['0a', '0b', '0c'], + ['1a', '1b', '1c'] + ]; + it('it collapses all columns to left', function () { + cy.loadAndVisitProject(fixture); + cy.columnActionClick('c', ['View', 'Collapse all columns to left']); + + cy.get('[title="a"]').should('to.contain', ''); + cy.get('[title="b"]').should('to.contain', ''); + + }); +}); diff --git a/main/tests/cypress/cypress/integration/project/grid/column/view/collapse_right.spec.js b/main/tests/cypress/cypress/integration/project/grid/column/view/collapse_right.spec.js new file mode 100644 index 000000000..a9c49896d --- /dev/null +++ b/main/tests/cypress/cypress/integration/project/grid/column/view/collapse_right.spec.js @@ -0,0 +1,16 @@ +describe(__filename, function () { +const fixture = [ + ['a', 'b', 'c'], + + ['0a', '0b', '0c'], + ['1a', '1b', '1c'] + ]; + it('it collapses all columns to right', function () { + cy.loadAndVisitProject(fixture); + cy.columnActionClick('a', ['View', 'Collapse all columns to right']); + + cy.get('[title="b"]').should('to.contain', ''); + cy.get('[title="c"]').should('to.contain', ''); + + }); +});