Skip to content

Commit

Permalink
fix: switch normal/frozen should always show Grid Menu on far right
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Sep 11, 2021
1 parent 47f74a9 commit 6bef090
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/src/controls/gridMenu.control.ts
Expand Up @@ -107,7 +107,7 @@ export class GridMenuControl {
}

get gridOptions(): GridOption {
return this.sharedService.gridOptions ?? {};
return this.grid?.getOptions?.() ?? {};
}

get grid(): SlickGrid {
Expand Down
24 changes: 24 additions & 0 deletions test/cypress/integration/example11.spec.js
Expand Up @@ -615,6 +615,14 @@ describe('Example 11 - Batch Editing', { retries: 1 }, () => {
cy.get('.grid-canvas-left > [style="top:0px"] > .slick-cell:nth(2)').contains(/^[0-9]*\sday[s]?$/);

cy.get('.grid-canvas-right > [style="top:0px"] > .slick-cell:nth(0)').contains(/\$[0-9\.]*/);

cy.get('.slick-pane-left')
.find('.slick-gridmenu-button')
.should('not.exist');

cy.get('.slick-pane-right')
.find('.slick-gridmenu-button')
.should('exist');
});

it('should create a new View with current pinning & filters', () => {
Expand Down Expand Up @@ -666,6 +674,14 @@ describe('Example 11 - Batch Editing', { retries: 1 }, () => {

cy.get('[style="top:0px"]').should('have.length', 1);
cy.get('.grid-canvas-left > [style="top:0px"]').children().should('have.length', 9);

cy.get('.slick-pane-left')
.find('.slick-gridmenu-button')
.should('exist');

cy.get('.slick-pane-right')
.find('.slick-gridmenu-button')
.should('not.exist');
});

it('should change pre-defined view back to the Custom View Test', () => {
Expand All @@ -689,6 +705,14 @@ describe('Example 11 - Batch Editing', { retries: 1 }, () => {
cy.get('.grid-canvas-left > [style="top:0px"] > .slick-cell:nth(2)').contains(/^[0-9]*\sday[s]?$/);

cy.get('.grid-canvas-right > [style="top:0px"] > .slick-cell:nth(0)').contains(/\$?[0-9\.]*/);

cy.get('.slick-pane-left')
.find('.slick-gridmenu-button')
.should('not.exist');

cy.get('.slick-pane-right')
.find('.slick-gridmenu-button')
.should('exist');
});

it('should have the same 3 filters defined in the CustomViewTest', () => {
Expand Down

0 comments on commit 6bef090

Please sign in to comment.