Skip to content

Commit

Permalink
fix(build): Remove Safari 7 from tests and switch $digest to "$apply"…
Browse files Browse the repository at this point in the history
… to add $$hashKey to data.
  • Loading branch information
Portugal, Marcelo authored and mportuga committed Mar 10, 2018
1 parent 25dbd2e commit 323fa95
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
6 changes: 0 additions & 6 deletions lib/grunt/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ var util = module.exports = {
base: 'SauceLabs',
browserName: 'firefox'
},
'SL_Safari_7': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'Mac 10.9',
version: '7'
},
'SL_Safari_8': {
base: 'SauceLabs',
browserName: 'safari',
Expand Down
22 changes: 11 additions & 11 deletions src/features/resize-columns/test/resizeColumns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('ui.grid.resizeColumns', function () {
grid = angular.element('<div style="width: 500px; height: 300px" ui-grid="gridOpts" ui-grid-resize-columns></div>');
document.body.appendChild(grid[0]);
$compile(grid)($scope);
$scope.$digest();
$scope.$apply();
gridScope = $(grid).isolateScope();
};

Expand Down Expand Up @@ -138,7 +138,7 @@ describe('ui.grid.resizeColumns', function () {

firstResizer.trigger('dblclick');

$scope.$digest();
$scope.$apply();

var newColWidth = $(grid).find('.' + uiGridConstants.COL_CLASS_PREFIX + '0').first().width();

Expand All @@ -152,7 +152,7 @@ describe('ui.grid.resizeColumns', function () {
var firstResizer = $(grid).find('[ui-grid-column-resizer]').first();

firstResizer.trigger(downEvent);
$scope.$digest();
$scope.$apply();

var overlay = $(grid).find('.ui-grid-resize-overlay');

Expand All @@ -175,15 +175,15 @@ describe('ui.grid.resizeColumns', function () {
initialX = firstResizer.position().left;

$(firstResizer).simulate(downEvent, { clientX: initialX });
$scope.$digest();
$scope.$apply();

// Get the overlay
overlay = $(grid).find('.ui-grid-resize-overlay');
initialOverlayX = $(overlay).position().left;

xDiff = 100;
$(document).simulate(moveEvent, { clientX: initialX + xDiff });
$scope.$digest();
$scope.$apply();
});

it('should add the column-resizing class to the grid', function () {
Expand All @@ -205,7 +205,7 @@ describe('ui.grid.resizeColumns', function () {
describe('then releasing the mouse', function () {
beforeEach(function () {
$(document).simulate(upEvent, { clientX: initialX + xDiff });
$scope.$digest();
$scope.$apply();
});

it('should cause the column to resize by the amount change in the X axis', function () {
Expand Down Expand Up @@ -261,10 +261,10 @@ describe('ui.grid.resizeColumns', function () {
initialX = firstResizer.position().left;

$(firstResizer).simulate(downEvent, { clientX: initialX });
$scope.$digest();
$scope.$apply();

$(document).simulate(upEvent, { clientX: initialX - minWidth });
$scope.$digest();
$scope.$apply();
});

it('should not go below the minWidth less border', function () {
Expand Down Expand Up @@ -299,7 +299,7 @@ describe('ui.grid.resizeColumns', function () {
var firstResizer = $(grid).find('[ui-grid-column-resizer]').first();

$(firstResizer).simulate('dblclick');
$scope.$digest();
$scope.$apply();

var firstColumnUid = gridScope.grid.columns[0].uid;

Expand All @@ -317,10 +317,10 @@ describe('ui.grid.resizeColumns', function () {
initialX = firstResizer.position().left;

$(firstResizer).simulate(downEvent, { clientX: initialX });
$scope.$digest();
$scope.$apply();

$(document).simulate(upEvent, { clientX: initialX + maxWidth });
$scope.$digest();
$scope.$apply();
});

it('should not go above the maxWidth', function () {
Expand Down
4 changes: 2 additions & 2 deletions src/features/selection/test/uiGridSelectionDirective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ui.grid.selection uiGridSelectionDirective', function() {
document.body.appendChild(elm[0]);
$compile(elm)(parentScope);
$timeout.flush();
parentScope.$digest();
parentScope.$apply();

return elm;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('ui.grid.selection uiGridSelectionDirective', function() {
parentScope.options.enableFiltering = false;
elm.controller('uiGrid').grid.api.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
$timeout.flush();
parentScope.$digest();
parentScope.$apply();

var noFilteringHeight = $(elm).find('.ui-grid-header').height();

Expand Down

0 comments on commit 323fa95

Please sign in to comment.