Skip to content

Commit 2106dc4

Browse files
committed
chore: fix tests
1 parent bc85bbc commit 2106dc4

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

e2e/sidebar-two.e2e-spec.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
import { browser, element, by } from 'protractor';
88

99
describe('nb-sidebar-two', () => {
10-
1110
beforeEach((done) => {
1211
browser.get('#/sidebar/sidebar-two-test.component').then(() => done());
1312
});
1413

1514
it('should render left non-fixed sidebar height minus header', () => {
16-
Promise.all<any, any, any>([
15+
Promise.all<any>([
1716
element(by.css('nb-layout')).getSize(),
1817
element(by.css('nb-layout-header')).getSize(),
1918
element.all(by.css('nb-sidebar')).get(0).getSize(),

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
"moment": "^2.22.2",
8686
"normalize.css": "8.0.0",
8787
"pace-js": "^1.0.2",
88+
"rxfire": "^6.0.0",
8889
"rxjs": "^7.4.0",
8990
"tslib": "^2.3.0",
90-
"zone.js": "~0.11.4",
91-
"rxfire": "^6.0.0"
91+
"zone.js": "~0.11.4"
9292
},
9393
"devDependencies": {
9494
"@angular-devkit/build-angular": "~14.2.6",

src/framework/theme/components/select-with-autocomplete/select-with-autocomplete.spec.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { Component, ElementRef, EventEmitter, Input, Output, QueryList, ViewChild, ViewChildren } from '@angular/core';
8-
import { ComponentFixture, fakeAsync, flush, TestBed } from '@angular/core/testing';
8+
import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
99
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
1010
import { By } from '@angular/platform-browser';
1111
import { RouterTestingModule } from '@angular/router/testing';
@@ -737,6 +737,8 @@ describe('NbSelectComponent - falsy values', () => {
737737
testComponent.noValueOption.onClick(eventMock);
738738
fixture.detectChanges();
739739

740+
tick(1000);
741+
740742
expect(select.selectionModel.length).toEqual(0);
741743
}));
742744

@@ -747,6 +749,8 @@ describe('NbSelectComponent - falsy values', () => {
747749
testComponent.nullOption.onClick(eventMock);
748750
fixture.detectChanges();
749751

752+
tick(1000);
753+
750754
expect(select.selectionModel.length).toEqual(0);
751755
}));
752756

@@ -757,6 +761,8 @@ describe('NbSelectComponent - falsy values', () => {
757761
testComponent.undefinedOption.onClick(eventMock);
758762
fixture.detectChanges();
759763

764+
tick(1000);
765+
760766
expect(select.selectionModel.length).toEqual(0);
761767
}));
762768

@@ -767,6 +773,8 @@ describe('NbSelectComponent - falsy values', () => {
767773
testComponent.falseOption.onClick(eventMock);
768774
fixture.detectChanges();
769775

776+
tick(1000);
777+
770778
expect(select.selectionModel.length).toEqual(1);
771779
}));
772780

@@ -777,6 +785,8 @@ describe('NbSelectComponent - falsy values', () => {
777785
testComponent.zeroOption.onClick(eventMock);
778786
fixture.detectChanges();
779787

788+
tick(1000);
789+
780790
expect(select.selectionModel.length).toEqual(1);
781791
}));
782792

@@ -787,6 +797,8 @@ describe('NbSelectComponent - falsy values', () => {
787797
testComponent.emptyStringOption.onClick(eventMock);
788798
fixture.detectChanges();
789799

800+
tick(1000);
801+
790802
expect(select.selectionModel.length).toEqual(1);
791803
}));
792804

@@ -797,6 +809,8 @@ describe('NbSelectComponent - falsy values', () => {
797809
testComponent.nanOption.onClick(eventMock);
798810
fixture.detectChanges();
799811

812+
tick(1000);
813+
800814
expect(select.selectionModel.length).toEqual(1);
801815
}));
802816

0 commit comments

Comments
 (0)