forked from PatrickJS/PatrickJS-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathx-large.directive.spec.ts
34 lines (29 loc) · 963 Bytes
/
x-large.directive.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {
it,
inject,
injectAsync,
describe,
beforeEachProviders,
TestComponentBuilder
} from 'angular2/testing';
import {Component, provide} from 'angular2/core';
import {BaseRequestOptions, Http} from 'angular2/http';
import {MockBackend} from 'angular2/http/testing';
// Load the implementations that should be tested
import {XLarge} from './x-large.directive';
describe('x-large directive', () => {
// Create a test component to test directives
@Component({
template: '',
directives: [ XLarge ]
})
class TestComponent {}
it('should sent font-size to x-large', injectAsync([TestComponentBuilder], (tcb) => {
return tcb.overrideTemplate(TestComponent, '<div x-large>Content</div>')
.createAsync(TestComponent).then((fixture: any) => {
fixture.detectChanges();
let compiled = fixture.debugElement.nativeElement.children[0];
expect(compiled.style.fontSize).toBe('x-large');
});
}));
});