Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
ESLINT - prefer-arrow-callback (#117)
Browse files Browse the repository at this point in the history
* Changed: eslint prefer-arrow-callback /**/*.js

* Change after merge  into
  • Loading branch information
swistach committed Aug 28, 2018
1 parent 462fef9 commit 64c03bc
Show file tree
Hide file tree
Showing 65 changed files with 1,064 additions and 1,091 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Expand Up @@ -54,7 +54,6 @@
"object-shorthand": 1,
"one-var": 0,
"padded-blocks": 0,
"prefer-arrow-callback": 1,
"prefer-const": 0,
"prefer-rest-params": 1,
"prefer-spread": 1,
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/bindRowsWithHeaders/test/bindRowsWithHeaders.e2e.js
@@ -1,4 +1,4 @@
describe('BindRowsWithHeaders', function() {
describe('BindRowsWithHeaders', () => {
var id = 'testContainer';

beforeEach(function() {
Expand All @@ -12,7 +12,7 @@ describe('BindRowsWithHeaders', function() {
}
});

it('should call rowHeader function with correct index as argument (strict mode)', function() {
it('should call rowHeader function with correct index as argument (strict mode)', () => {
var callback = jasmine.createSpy();
handsontable({
data: Handsontable.helper.createSpreadsheetData(5, 10),
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('BindRowsWithHeaders', function() {
expect(getRowHeader()).toEqual([1, 2, 3, 4, 5]);
});

it('should correct bind rows with headers when row was removed (strict mode)', function() {
it('should correct bind rows with headers when row was removed (strict mode)', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
rowHeaders: true,
Expand All @@ -73,7 +73,7 @@ describe('BindRowsWithHeaders', function() {
expect(getRowHeader()).toEqual([1, 6, 7, 8, 9, 10]);
});

it('should correct bind rows with headers when row was inserted (strict mode)', function() {
it('should correct bind rows with headers when row was inserted (strict mode)', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(4, 10),
rowHeaders: true,
Expand All @@ -87,7 +87,7 @@ describe('BindRowsWithHeaders', function() {
expect(getRowHeader()).toEqual([1, 5, 6, 7, 8, 2, 3, 4]);
});

it('should correct bind rows with headers when row was inserted and removed in mixed way (strict mode)', function() {
it('should correct bind rows with headers when row was inserted and removed in mixed way (strict mode)', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(4, 10),
rowHeaders: true,
Expand All @@ -103,7 +103,7 @@ describe('BindRowsWithHeaders', function() {
expect(getRowHeader()).toEqual([7, 8, 2, 9, 3, 4]);
});

describe('column sorting', function() {
describe('column sorting', () => {
it('should correct bind rows with headers when row was removed after sorting (strict mode)', async () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
Expand Down
20 changes: 10 additions & 10 deletions src/plugins/bindRowsWithHeaders/test/bindStrategy.unit.js
@@ -1,15 +1,15 @@
import BindStrategy from 'handsontable-pro/plugins/bindRowsWithHeaders/bindStrategy';

describe('BindRowsWithHeaders -> BindStrategy', function() {
it('should throw error when used strategy is not exists', function() {
describe('BindRowsWithHeaders -> BindStrategy', () => {
it('should throw error when used strategy is not exists', () => {
var strategy = new BindStrategy();

expect(function() {
expect(() => {
strategy.setStrategy('test2');
}).toThrow();
});

it('should create a map based on `length` argument', function() {
it('should create a map based on `length` argument', () => {
var strategyMock = { _arrayMap: [] };
var strategy = new BindStrategy();

Expand All @@ -23,7 +23,7 @@ describe('BindRowsWithHeaders -> BindStrategy', function() {
expect(strategy.strategy._arrayMap[4]).toBe(void 0);
});

it('should re-create a map based on current map length', function() {
it('should re-create a map based on current map length', () => {
var strategyMock = { _arrayMap: [] };
var strategy = new BindStrategy();

Expand All @@ -39,7 +39,7 @@ describe('BindRowsWithHeaders -> BindStrategy', function() {
expect(strategy.strategy._arrayMap[3]).toBe(void 0);
});

it('should forward `createRow` method call to the strategy object', function() {
it('should forward `createRow` method call to the strategy object', () => {
var strategyMock = jasmine.createSpyObj('strategy', ['createRow']);
var strategy = new BindStrategy();

Expand All @@ -53,7 +53,7 @@ describe('BindRowsWithHeaders -> BindStrategy', function() {
expect(strategyMock.createRow.calls.argsFor(1)).toEqual([3]);
});

it('should forward `removeRow` method call to the strategy object', function() {
it('should forward `removeRow` method call to the strategy object', () => {
var strategyMock = jasmine.createSpyObj('strategy', ['removeRow']);
var strategy = new BindStrategy();

Expand All @@ -67,7 +67,7 @@ describe('BindRowsWithHeaders -> BindStrategy', function() {
expect(strategyMock.removeRow.calls.argsFor(1)).toEqual([3]);
});

it('should forward `translate` method call to the strategy object', function() {
it('should forward `translate` method call to the strategy object', () => {
var strategyMock = jasmine.createSpyObj('strategy', ['getValueByIndex']);
var strategy = new BindStrategy();

Expand All @@ -77,7 +77,7 @@ describe('BindRowsWithHeaders -> BindStrategy', function() {
expect(strategyMock.getValueByIndex.calls.argsFor(0)).toEqual([1]);
});

it('should forward `clearMap` method call to the strategy object', function() {
it('should forward `clearMap` method call to the strategy object', () => {
var strategyMock = jasmine.createSpyObj('strategy', ['clearMap']);
var strategy = new BindStrategy();

Expand All @@ -87,7 +87,7 @@ describe('BindRowsWithHeaders -> BindStrategy', function() {
expect(strategyMock.clearMap).toHaveBeenCalled();
});

it('should destroy object after call `destroy` method', function() {
it('should destroy object after call `destroy` method', () => {
var strategyMock = jasmine.createSpyObj('strategy', ['destroy']);
var strategy = new BindStrategy();

Expand Down
24 changes: 11 additions & 13 deletions src/plugins/collapsibleColumns/test/collapsibleColumns.e2e.js
@@ -1,4 +1,4 @@
describe('CollapsibleColumns', function() {
describe('CollapsibleColumns', () => {
var id = 'testContainer';

beforeEach(function() {
Expand Down Expand Up @@ -53,8 +53,8 @@ describe('CollapsibleColumns', function() {
}
});

describe('initialization', function() {
it('should be possible to disable the plugin using the disablePlugin method', function() {
describe('initialization', () => {
it('should be possible to disable the plugin using the disablePlugin method', () => {
var hot = handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
hiddenColumns: true,
Expand All @@ -75,7 +75,7 @@ describe('CollapsibleColumns', function() {
expect($('.collapsibleIndicator').size()).toEqual(0);
});

it('should be possible to re-enable the plugin using the enablePlugin method', function() {
it('should be possible to re-enable the plugin using the enablePlugin method', () => {
var hot = handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
hiddenColumns: true,
Expand All @@ -96,7 +96,7 @@ describe('CollapsibleColumns', function() {
expect($('.collapsibleIndicator').size()).toBeGreaterThan(0);
});

it('should be possible to initialize the plugin using the updateSettings method', function() {
it('should be possible to initialize the plugin using the updateSettings method', () => {
var hot = handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
hiddenColumns: true,
Expand All @@ -115,9 +115,8 @@ describe('CollapsibleColumns', function() {

});

describe('collapsing headers functionality', function() {

it('should hide all "child" columns except the first one after clicking the "collapse/expand" button/indicator', function() {
describe('collapsing headers functionality', () => {
it('should hide all "child" columns except the first one after clicking the "collapse/expand" button/indicator', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
hiddenColumns: true,
Expand Down Expand Up @@ -150,7 +149,7 @@ describe('CollapsibleColumns', function() {
expect(parseInt(colgroupArray.eq(6).width(), 10)).toBeGreaterThan(0);
});

it('should hide all the "child" columns except the first "child" group, (if a "child group" exists), after clicking the collapse/expand button', function() {
it('should hide all the "child" columns except the first "child" group, (if a "child group" exists), after clicking the collapse/expand button', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
hiddenColumns: true,
Expand Down Expand Up @@ -211,9 +210,8 @@ describe('CollapsibleColumns', function() {
});
});

describe('expand headers functionality', function() {

it('should expand all the "child" columns of the colspanned header afte clicking the expand button', function() {
describe('expand headers functionality', () => {
it('should expand all the "child" columns of the colspanned header afte clicking the expand button', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(10, 10),
hiddenColumns: true,
Expand Down Expand Up @@ -258,7 +256,7 @@ describe('CollapsibleColumns', function() {
height: 300
});

setTimeout(function() {
setTimeout(() => {
hot.scrollViewportTo(void 0, 37);
hot.render();

Expand Down

0 comments on commit 64c03bc

Please sign in to comment.