Skip to content

Commit

Permalink
test(search): add test for issue #3631
Browse files Browse the repository at this point in the history
  • Loading branch information
DiyanDimitrov committed Jan 17, 2019
1 parent 382080f commit 0019348
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions projects/igniteui-angular/src/lib/grids/grid/grid.search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DefaultSortingStrategy } from '../../data-operations/sorting-strategy';
import { configureTestSuite } from '../../test-utils/configure-suite';
import { wait } from '../../test-utils/ui-interactions.spec';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { DataType } from '../../data-operations/data-util';

describe('IgxGrid - search API', () => {
configureTestSuite();
Expand Down Expand Up @@ -464,6 +465,33 @@ describe('IgxGrid - search API', () => {
expect(activeHighlight).toBe(highlights[0]);
});

it('Highlight should be updated when a column is hidden/shown and columns have different data types', () => {
grid.columns[0].dataType = DataType.Number;
fix.detectChanges();

let cell = grid.getCellByColumn(0, 'ID').nativeElement;
let activeHighlight: any;
let highlights: any[];

grid.findNext('1');

activeHighlight = cell.querySelector('.' + component.activeClass);
highlights = cell.querySelectorAll('.' + component.highlightClass);
expect(highlights.length).toBe(1);
expect(activeHighlight).toBe(highlights[0]);

grid.columns[0].hidden = true;
fix.detectChanges();

grid.columns[0].hidden = false;
fix.detectChanges();

cell = grid.getCellByColumn(0, 'ID').nativeElement;
highlights = cell.querySelectorAll('.' + component.highlightClass);
expect(highlights.length).toBe(1);
expect(cell.innerText).toBe('1');
});

it('Clear filter properly updates the highlights', async () => {
let gilbertoDirectorCell = grid.getCellByColumn(1, 'JobTitle').nativeElement;
let tanyaDirectorCell = grid.getCellByColumn(2, 'JobTitle').nativeElement;
Expand Down

0 comments on commit 0019348

Please sign in to comment.