From 39a48be94a12a1254c83616877c596138811b182 Mon Sep 17 00:00:00 2001 From: Diyan Dimitrov Date: Thu, 17 Jan 2019 09:20:08 +0200 Subject: [PATCH] fix(search): fix converting nodeLists to array #3637 --- .../directives/text-highlight/text-highlight.directive.ts | 4 ++-- .../src/lib/grids/grid/grid.search.spec.ts | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts index d42ab9158e2..fa6e1013f0c 100644 --- a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts +++ b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts @@ -318,7 +318,7 @@ export class IgxTextHighlightDirective implements AfterViewInit, OnDestroy, OnCh if (this._observer === null) { const callback = (mutationList) => { mutationList.forEach((mutation) => { - const removedNodes = new Array(... mutation.removedNodes); + const removedNodes = Array.from(mutation.removedNodes); removedNodes.forEach((n) => { if (n === this._container) { this._nodeWasRemoved = true; @@ -326,7 +326,7 @@ export class IgxTextHighlightDirective implements AfterViewInit, OnDestroy, OnCh } }); - const addedNodes = new Array(... mutation.addedNodes); + const addedNodes = Array.from(mutation.addedNodes); addedNodes.forEach((n) => { if (n === this.parentElement.firstElementChild && this._nodeWasRemoved) { this._container = this.parentElement.firstElementChild; diff --git a/projects/igniteui-angular/src/lib/grids/grid/grid.search.spec.ts b/projects/igniteui-angular/src/lib/grids/grid/grid.search.spec.ts index 7563af922db..5f38065840e 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/grid.search.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/grid/grid.search.spec.ts @@ -714,8 +714,7 @@ describe('IgxGrid - search API', () => { expect(isInView(3, grid.rowList.first.virtDirRow.state)).toBeTruthy(); }); - fit('should keep the active highlight when active cell enters and exits edit mode', async () => { - // pending('When the cell enters edit mode, the highlight stays and the content is doubled! Happens in tests only!'); + it('should keep the active highlight when active cell enters and exits edit mode', async () => { const rv = fix.debugElement.query(By.css(CELL_CSS_CLASS)).nativeElement; const cell = grid.getCellByColumn(0, 'ID'); const initialValue = rv.textContent; @@ -732,7 +731,6 @@ describe('IgxGrid - search API', () => { expect(activeHighlight).not.toBeNull(); cell.inEditMode = true; - // fix.detectChanges(); await wait(16); fix.detectChanges(); @@ -750,9 +748,7 @@ describe('IgxGrid - search API', () => { expect(activeHighlight).not.toBeNull(); }); - fit('should update highlights when a new value is entered', async () => { - // pending('When the cell enters edit mode, the highlight stays and the content is doubled! Happens in tests only!'); - + it('should update highlights when a new value is entered', async () => { const rv = fix.debugElement.query(By.css(CELL_CSS_CLASS)); const cell = grid.getCellByColumn(0, 'ID'); cell.column.editable = true;