Skip to content

Commit

Permalink
Merge pull request #174 from mminer/test-menu-extensions-position
Browse files Browse the repository at this point in the history
Add test for menu extensions positioning
  • Loading branch information
Globex Designs, Inc committed Dec 19, 2014
2 parents 4c6b1cb + ff6dae6 commit b832780
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/gridoptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,35 @@ describe("Grid Options", function () {
// Close dropdowns
$(document.body).find('.doby-grid-dropdown').remove();
});


// ==========================================================================================


it("should render in the appropriate place when supplied a position", function () {
var grid = resetGrid($.extend(defaultData(), {
menuExtensions: function () {
return [{
name: "Test"
}];
},
menuExtensionsPosition: "top"
}));

// Simulate context click on the grid
grid.$el.find('.doby-grid-cell:first').simulate('contextmenu');

// Make sure the context menu comes up
expect($(document.body)).toContainElement('.doby-grid-dropdown');

var $dropdown = $(document.body).find('.doby-grid-dropdown:first');

// Make sure the extension item is displayed at the top
expect($dropdown.find('.doby-grid-dropdown-item').first()).toHaveText('Test');

// Close dropdowns
$(document.body).find('.doby-grid-dropdown').remove();
});
});


Expand Down

0 comments on commit b832780

Please sign in to comment.