Skip to content

Commit 22b0576

Browse files
committed
test(MdInput): Update empty check tests to match the other tests new syntax
1 parent 121486a commit 22b0576

File tree

1 file changed

+32
-40
lines changed

1 file changed

+32
-40
lines changed

src/components/input/input.spec.ts

Lines changed: 32 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,61 +35,53 @@ describe('MdInput', function () {
3535
});
3636
}));
3737

38-
it('should not be treated as empty if type is date', () => {
39-
return builder.createAsync(MdInputDateTestController)
38+
it('should not be treated as empty if type is date', async(() => {
39+
builder.createAsync(MdInputDateTestController)
4040
.then(fixture => {
41-
fakeAsync(() => {
42-
fixture.componentInstance.placeholder = 'Placeholder';
43-
fixture.detectChanges();
41+
fixture.componentInstance.placeholder = 'Placeholder';
42+
fixture.detectChanges();
4443

45-
let el = fixture.debugElement.query(By.css('label')).nativeElement;
46-
expect(el).not.toBeNull();
47-
expect(el.className.includes('md-empty')).toBe(false);
48-
})();
44+
let el = fixture.debugElement.query(By.css('label')).nativeElement;
45+
expect(el).not.toBeNull();
46+
expect(el.className.includes('md-empty')).toBe(false);
4947
});
50-
});
48+
}));
5149

52-
it('should treat text input type as empty at init', () => {
53-
return builder.createAsync(MdInputTextTestController)
50+
it('should treat text input type as empty at init', async(() => {
51+
builder.createAsync(MdInputTextTestController)
5452
.then(fixture => {
55-
fakeAsync(() => {
56-
fixture.componentInstance.placeholder = 'Placeholder';
57-
fixture.detectChanges();
53+
fixture.componentInstance.placeholder = 'Placeholder';
54+
fixture.detectChanges();
5855

59-
let el = fixture.debugElement.query(By.css('label')).nativeElement;
60-
expect(el).not.toBeNull();
61-
expect(el.className.includes('md-empty')).toBe(true);
62-
})();
56+
let el = fixture.debugElement.query(By.css('label')).nativeElement;
57+
expect(el).not.toBeNull();
58+
expect(el.className.includes('md-empty')).toBe(true);
6359
});
64-
});
60+
}));
6561

66-
it('should treat password input type as empty at init', () => {
67-
return builder.createAsync(MdInputPasswordTestController)
62+
it('should treat password input type as empty at init', async(() => {
63+
builder.createAsync(MdInputPasswordTestController)
6864
.then(fixture => {
69-
fakeAsync(() => {
70-
fixture.componentInstance.placeholder = 'Placeholder';
71-
fixture.detectChanges();
65+
fixture.componentInstance.placeholder = 'Placeholder';
66+
fixture.detectChanges();
7267

73-
let el = fixture.debugElement.query(By.css('label')).nativeElement;
74-
expect(el).not.toBeNull();
75-
expect(el.className.includes('md-empty')).toBe(true);
76-
})();
68+
let el = fixture.debugElement.query(By.css('label')).nativeElement;
69+
expect(el).not.toBeNull();
70+
expect(el.className.includes('md-empty')).toBe(true);
7771
});
78-
});
72+
}));
7973

80-
it('should treat number input type as empty at init', () => {
81-
return builder.createAsync(MdInputNumberTestController)
74+
it('should treat number input type as empty at init', async(() => {
75+
builder.createAsync(MdInputNumberTestController)
8276
.then(fixture => {
83-
fakeAsync(() => {
84-
fixture.componentInstance.placeholder = 'Placeholder';
85-
fixture.detectChanges();
77+
fixture.componentInstance.placeholder = 'Placeholder';
78+
fixture.detectChanges();
8679

87-
let el = fixture.debugElement.query(By.css('label')).nativeElement;
88-
expect(el).not.toBeNull();
89-
expect(el.className.includes('md-empty')).toBe(true);
90-
})();
80+
let el = fixture.debugElement.query(By.css('label')).nativeElement;
81+
expect(el).not.toBeNull();
82+
expect(el.className.includes('md-empty')).toBe(true);
9183
});
92-
});
84+
}));
9385

9486
it('support ngModel', async(() => {
9587
builder.createAsync(MdInputBaseTestController)

0 commit comments

Comments
 (0)