Skip to content

Commit

Permalink
Merge pull request #3272 from PaulL1/fixes2
Browse files Browse the repository at this point in the history
Fix(gridMenu): unit tests breaking on sauce, suspect unstable sort
  • Loading branch information
PaulL1 committed Apr 13, 2015
2 parents bcf1245 + e47e273 commit e1d8b60
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/unit/core/directives/ui-grid-menu-button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ describe('ui-grid-menu-button uiGridGridMenuService', function () {
});

it('grab bag of stuff', function () {
grid.options.gridMenuCustomItems = [ { title: 'z' }, { title: 'a' }];
grid.options.gridMenuCustomItems = [ { title: 'z', order: 11 }, { title: 'a', order: 12 }];
grid.options.gridMenuTitleFilter = function( title ) {return 'fn_' + title;};
var registeredMenuItems = [ { id: 'customItem1', title: 'x' }, { id: 'customItem2', title: 'y' } ];
var registeredMenuItems = [ { id: 'customItem1', title: 'x', order: 1 }, { id: 'customItem2', title: 'y', order: 2 } ];
grid.options.columnDefs[1].enableHiding = false;

uiGridGridMenuService.addToGridMenu( grid, registeredMenuItems );

var menuItems = uiGridGridMenuService.getMenuItems( $scope );

expect( menuItems.length ).toEqual(11, 'Should be 11 items, 2 from customItems, 2 from registered, 1 columns header, and 2x3 columns that allow hiding');
expect( menuItems[0].title ).toEqual('z', 'Menu item 0 should be from customItem');
expect( menuItems[1].title ).toEqual('a', 'Menu item 1 should be from customItem');
expect( menuItems[2].title ).toEqual('x', 'Menu item 2 should be from register');
expect( menuItems[3].title ).toEqual('y', 'Menu item 3 should be from register');
expect( menuItems[0].title ).toEqual('x', 'Menu item 0 should be from register');
expect( menuItems[1].title ).toEqual('y', 'Menu item 1 should be from register');
expect( menuItems[2].title ).toEqual('z', 'Menu item 2 should be from customItem');
expect( menuItems[3].title ).toEqual('a', 'Menu item 3 should be from customItem');

expect( menuItems[4].title ).toEqual('Columns:', 'Menu item 4 should be header');
expect( menuItems[5].title ).toEqual('fn_col1', 'Menu item 5 should be col1');
Expand Down

0 comments on commit e1d8b60

Please sign in to comment.