Skip to content

Commit

Permalink
fix(Tests): Mistakenly using classList
Browse files Browse the repository at this point in the history
IE9 doesn't support classList, needed to use className and split on
whitespace
  • Loading branch information
c0bra committed Jan 29, 2015
1 parent 865573c commit 04d2fa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/core/directives/uiGridCell.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('uiGridCell', function () {
}));
});

it('should change a columns class when its uid changes', inject(function (gridUtil, $compile, uiGridConstants) {
iit('should change a columns class when its uid changes', inject(function (gridUtil, $compile, uiGridConstants) {
// Reset the UIDs (used by columns) so they're fresh and clean
gridUtil.resetUids();

Expand All @@ -110,7 +110,7 @@ describe('uiGridCell', function () {
var firstCol = $(gridElm).find('.ui-grid-cell').first();
var firstHeaderCell = $(gridElm).find('.ui-grid-header-cell').first();
var classRegEx = new RegExp('^' + uiGridConstants.COL_CLASS_PREFIX);
var class1 = _(firstCol[0].classList).find(function(c) { return classRegEx.test(c); });
var class1 = _(firstCol[0].className.split(/\s+/)).find(function(c) { return classRegEx.test(c); });

// The first column should be 100px wide because we said it should be
expect(firstCol.outerWidth()).toEqual(100, 'first cell is 100px');
Expand All @@ -122,7 +122,7 @@ describe('uiGridCell', function () {

var firstColAgain = $(gridElm).find('.ui-grid-cell').first();
var firstHeaderCellAgain = $(gridElm).find('.ui-grid-header-cell').first();
var class2 = _(firstColAgain[0].classList).find(function(c) { return classRegEx.test(c); });
var class2 = _(firstColAgain[0].className.split(/\s+/)).find(function(c) { return classRegEx.test(c); });

// The column root classes should have changed
expect(class2).not.toEqual(class1);
Expand Down

0 comments on commit 04d2fa6

Please sign in to comment.