diff --git a/projects/igniteui-angular/src/lib/combo/combo.component.spec.ts b/projects/igniteui-angular/src/lib/combo/combo.component.spec.ts index 92e6099bcd3..e5d2a417dcc 100644 --- a/projects/igniteui-angular/src/lib/combo/combo.component.spec.ts +++ b/projects/igniteui-angular/src/lib/combo/combo.component.spec.ts @@ -483,7 +483,7 @@ describe('igxCombo', () => { const dropdownList = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWNLIST)).nativeElement; expect(dropdownList.classList.contains(CSS_CLASS_TOGGLE)).toBeTruthy(); const dropdownItems = dropdownList.querySelectorAll('.' + CSS_CLASS_DROPDOWNLISTITEM); - expect(dropdownItems.length).toEqual(12); + expect(dropdownItems.length).toEqual(11); comboButton.click(); tick(); fixture.detectChanges(); @@ -652,7 +652,7 @@ describe('igxCombo', () => { dropdownContainer = fixture.debugElement.query(By.css('.' + CSS_CLASS_CONTAINER)).nativeElement; firstVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':first-child'); lastVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':last-child'); - expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 12]); + expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 11]); expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 1]); expect(firstVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeFalsy(); expect(lastVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeTruthy(); @@ -664,7 +664,7 @@ describe('igxCombo', () => { firstVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':first-child'); lastVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':last-child'); expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[0]); - expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[11]); + expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[10]); combo.dropdown.verticalScrollContainer.scrollTo(10); setTimeout(function () { fixture.detectChanges(); @@ -673,7 +673,7 @@ describe('igxCombo', () => { lastVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':last-child'); expect(firstVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeFalsy(); expect(lastVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeTruthy(); - expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[12]); + expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[11]); dropdownContent.dispatchEvent(homeEvent); setTimeout(function () { fixture.detectChanges(); @@ -681,7 +681,7 @@ describe('igxCombo', () => { firstVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':first-child'); lastVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':last-child'); expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[0]); - expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[11]); + expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[10]); expect(firstVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeTruthy(); expect(lastVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeFalsy(); expect(scrollbar.scrollTop).toEqual(0); @@ -714,7 +714,7 @@ describe('igxCombo', () => { dropdownContainer = fixture.debugElement.query(By.css('.' + CSS_CLASS_CONTAINER)).nativeElement; firstVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':first-child'); lastVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':last-child'); - expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 12]); + expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 11]); expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 1]); expect(firstVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeFalsy(); expect(lastVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeTruthy(); @@ -730,7 +730,7 @@ describe('igxCombo', () => { dropdownContainer = fixture.debugElement.query(By.css('.' + CSS_CLASS_CONTAINER)).nativeElement; firstVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':first-child'); lastVisibleItem = dropdownContainer.querySelector('.' + CSS_CLASS_DROPDOWNLISTITEM + ':last-child'); - expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 12]); + expect(firstVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 11]); expect(lastVisibleItem.textContent.trim()).toEqual(combo.data[combo.data.length - 1]); expect(scrollbar.scrollHeight - scrollbar.scrollTop).toEqual(scrollbar.clientHeight); expect(firstVisibleItem.classList.contains(CSS_CLASS_FOCUSED)).toBeFalsy(); @@ -1139,7 +1139,7 @@ describe('igxCombo', () => { const fixture = TestBed.createComponent(IgxComboTestComponent); fixture.detectChanges(); const combo = fixture.componentInstance.combo; - const expectedOutput = combo.data[3] + ', ' + combo.data[7] + ', ' + combo.data[1] + ', ' + combo.data[10]; + const expectedOutput = combo.data[3] + ', ' + combo.data[7] + ', ' + combo.data[1] + ', ' + combo.data[11]; const comboButton = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWNBUTTON)).nativeElement; comboButton.click(); fixture.detectChanges(); @@ -2258,7 +2258,7 @@ describe('igxCombo', () => { fix.detectChanges(); expect(combo.collapsed).toBeFalsy(); expect(combo.dropdown.headers).toBeDefined(); - expect(combo.dropdown.headers.length).toEqual(3); + expect(combo.dropdown.headers.length).toEqual(2); combo.dropdown.headers[0].clicked(null); fix.detectChanges(); diff --git a/projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts b/projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts index 96f569aa94f..c3873ee3121 100644 --- a/projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts +++ b/projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts @@ -380,7 +380,7 @@ describe('IgxForOf directive -', () => { it('should detect width change and update initially rendered columns', () => { let rows = displayContainer.querySelectorAll('igx-display-container'); - expect(rows.length).toBe(10); + expect(rows.length).toBe(9); for (let i = 0; i < rows.length; i++) { expect(rows[i].children.length).toBe(7); expect(rows[i].children[3].textContent) @@ -392,7 +392,7 @@ describe('IgxForOf directive -', () => { fix.detectChanges(); rows = displayContainer.querySelectorAll('igx-display-container'); - expect(rows.length).toBe(10); + expect(rows.length).toBe(9); for (let i = 0; i < rows.length; i++) { expect(rows[i].children.length).toBe(9); expect(rows[i].children[4].textContent) @@ -402,7 +402,7 @@ describe('IgxForOf directive -', () => { it('should detect height change and update initially rendered rows', () => { let rows = displayContainer.querySelectorAll('igx-display-container'); - expect(rows.length).toBe(10); + expect(rows.length).toBe(9); for (let i = 0; i < rows.length; i++) { expect(rows[i].children.length).toBe(7); expect(rows[i].children[2].textContent) @@ -414,7 +414,7 @@ describe('IgxForOf directive -', () => { fix.detectChanges(); rows = displayContainer.querySelectorAll('igx-display-container'); - expect(rows.length).toBe(16); + expect(rows.length).toBe(15); for (let i = 0; i < rows.length; i++) { expect(rows[i].children.length).toBe(7); expect(rows[i].children[2].textContent) @@ -430,7 +430,7 @@ describe('IgxForOf directive -', () => { expect(horizontalScroller).not.toBeNull(); expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); /** Step 1. Lower the amount of rows to 5. The vertical scrollbar then should not be rendered */ expect(() => { @@ -471,7 +471,7 @@ describe('IgxForOf directive -', () => { expect(horizontalScroller.scrollLeft).toBe(1000); expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); }); it('should not render vertical scrollbars when number of rows change to 0 after scrolling down', async () => { @@ -482,7 +482,7 @@ describe('IgxForOf directive -', () => { expect(horizontalScroller).not.toBeNull(); expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); dg.generateData300x50000(fix.componentInstance); fix.detectChanges(); @@ -524,7 +524,7 @@ describe('IgxForOf directive -', () => { expect(verticalScroller.scrollTop).toBe(0); expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); }); it('should not render vertical scrollbar when number of rows change to 0 after scrolling right', async () => { @@ -533,7 +533,7 @@ describe('IgxForOf directive -', () => { expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); expect(colsRendered.length).toBe(7); /** Step 1. Scroll to the right. */ @@ -581,7 +581,7 @@ describe('IgxForOf directive -', () => { // expect(horizontalScroller.scrollLeft).toBe(0); To be investigated expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); // expect(colsRendered.length).toBe(4); To be investigated for (let i = 0; i < rowsRendered.length; i++) { @@ -597,7 +597,7 @@ describe('IgxForOf directive -', () => { expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); expect(colsRendered.length).toBe(7); /** Step 1. Lower the amount of cols to 3 so there would be no horizontal scrollbar */ @@ -615,7 +615,7 @@ describe('IgxForOf directive -', () => { expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(false); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); expect(colsRendered.length).toBe(3); /** Step 2. Scroll down. There should be no errors then and everything should be still the same */ @@ -634,7 +634,7 @@ describe('IgxForOf directive -', () => { expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(false); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); expect(colsRendered.length).toBe(3); /** Step 3. Set the data back to have 300 columns and the horizontal scrollbar should render now. */ @@ -653,7 +653,7 @@ describe('IgxForOf directive -', () => { expect(verticalScroller.scrollTop).toBe(1000); expect(fix.componentInstance.isVerticalScrollbarVisible()).toBe(true); expect(fix.componentInstance.isHorizontalScrollbarVisible()).toBe(true); - expect(rowsRendered.length).toBe(10); + expect(rowsRendered.length).toBe(9); expect(colsRendered.length).toBe(7); }); @@ -848,7 +848,7 @@ describe('IgxForOf directive -', () => { const rowsRendered = displayContainer.querySelectorAll('igx-display-container'); for (let i = 0; i < 8; i++) { expect(rowsRendered[i].children[1].textContent) - .toBe(fix.componentInstance.data[49990 + i][1].toString()); + .toBe(fix.componentInstance.data[49991 + i][1].toString()); } wait().then(done); }); @@ -892,7 +892,7 @@ describe('IgxForOf directive -', () => { expect(chunkPreLoadSpy).toHaveBeenCalledTimes(1); // change size so that chunk size does not change - fix.componentInstance.height = '401px'; + fix.componentInstance.height = '399px'; fix.detectChanges(); await wait(); diff --git a/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.spec.ts b/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.spec.ts index 2a40872bb8e..f9e64c8f530 100644 --- a/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.spec.ts @@ -88,7 +88,7 @@ describe('IgxTreeGrid Component Tests', () => { expect(defaultHeightNum).toBeGreaterThan(300); expect(defaultHeightNum).toBeLessThan(330); expect(fix.componentInstance.isVerticalScrollbarVisible()).toBeTruthy(); - expect(grid.rowList.length).toEqual(12); + expect(grid.rowList.length).toEqual(11); })); });