Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Commit b6c52ff

Browse files
authored
Added: test spec, tslint rule no-unused-variable, Removed: unnecessary import. #76 (#88)
1 parent eafa05d commit b6c52ff

5 files changed

Lines changed: 24 additions & 5 deletions

File tree

lib/ce/src/hot-column.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
Component,
3-
Injector,
43
OnInit,
54
OnChanges,
65
OnDestroy,
@@ -100,7 +99,6 @@ export class HotColumnComponent implements OnInit, OnChanges, OnDestroy {
10099
@Input() rowHeaderWidth: number | number[];
101100
@Input() rowHeights: number | number[] | string | ((row: number) => number);
102101
@Input() search: boolean;
103-
@Input() selectionMode: string;
104102
@Input() selectOptions: string[] | number[];
105103
@Input() skipColumnOnPaste: boolean;
106104
@Input() sortByRelevance: boolean;

lib/pro/src/hot-column.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
Component,
3-
Injector,
43
OnInit,
54
OnChanges,
65
OnDestroy,
@@ -101,7 +100,6 @@ export class HotColumnComponent implements OnInit, OnChanges, OnDestroy {
101100
@Input() rowHeaderWidth: number | number[];
102101
@Input() rowHeights: number | number[] | string | ((row: number) => number);
103102
@Input() search: boolean;
104-
@Input() selectionMode: string;
105103
@Input() selectOptions: string[] | number[];
106104
@Input() skipColumnOnPaste: boolean;
107105
@Input() sortByRelevance: boolean;

src/app/hot-column.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import * as Handsontable from 'handsontable-pro';
32

43
import { HotTableModule } from '@handsontable-pro/angular';
54
import { TestComponent } from './test.component';

src/app/hot-table.component.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,29 @@ describe('HotTableComponent', () => {
16561656
});
16571657
});
16581658

1659+
it(`should set selectionMode defined as bindings`, () => {
1660+
TestBed.overrideComponent(TestComponent, {
1661+
set: {
1662+
template: `<hot-table [hotId]="id" [selectionMode]="prop.selectionMode"></hot-table>`
1663+
}
1664+
});
1665+
TestBed.compileComponents().then(() => {
1666+
fixture = TestBed.createComponent(TestComponent);
1667+
const app = fixture.componentInstance;
1668+
1669+
fixture.detectChanges();
1670+
expect(app.getHotInstance(app.id).getSettings()['selectionMode']).toBe('multiple');
1671+
1672+
app.prop['selectionMode'] = 'single';
1673+
fixture.detectChanges();
1674+
expect(app.getHotInstance(app.id).getSettings()['selectionMode']).toBe('single');
1675+
1676+
app.prop['selectionMode'] = 'range';
1677+
fixture.detectChanges();
1678+
expect(app.getHotInstance(app.id).getSettings()['selectionMode']).toBe('range');
1679+
});
1680+
});
1681+
16591682
it(`should set selectOptions defined as bindings`, () => {
16601683
TestBed.overrideComponent(TestComponent, {
16611684
set: {

tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"no-switch-case-fall-through": true,
5555
"no-trailing-whitespace": true,
5656
"no-unused-expression": true,
57+
"no-unused-variable": true,
5758
"no-use-before-declare": true,
5859
"no-var-keyword": true,
5960
"object-literal-sort-keys": false,

0 commit comments

Comments
 (0)