Skip to content

Commit d56dad3

Browse files
committed
test
1 parent af9fa5d commit d56dad3

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed
Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
import {
2-
async,
3-
addProviders,
4-
inject
2+
ComponentFixture, TestBed
53
} from '@angular/core/testing';
6-
import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
7-
import { provide, Component } from '@angular/core';
4+
import { Component, DebugElement } from '@angular/core';
85
import { ImgFallbackDirective } from './ngx-img-fallback.directive';
6+
import { By } from '@angular/platform-browser';
97

108
@Component({
119
selector: 'test-component',
12-
template: `<div src-fallback></div>`
10+
template: `<img src-fallback>`
1311
})
12+
1413
class TestComponent {}
1514

1615
describe('Ng2ImgFallback Directive', () => {
17-
beforeEach(() => addProviders([]));
16+
let component: TestComponent;
17+
let fixture: ComponentFixture<TestComponent>;
18+
let imgElement: DebugElement;
19+
20+
TestBed.configureTestingModule({
21+
declarations: [
22+
TestComponent,
23+
ImgFallbackDirective
24+
]
25+
});
26+
27+
fixture = TestBed.createComponent(TestComponent);
28+
component = fixture.componentInstance;
29+
imgElement = fixture.debugElement.query(By.css('img'));
1830

19-
it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => {
20-
return tcb.createAsync(TestComponent).then((fixture: ComponentFixture<any>) => {
21-
fixture.detectChanges();
22-
});
23-
})));
31+
it('should set placeholder', () => {
32+
// imgElement.
33+
expect(true).toBeTruthy();
34+
});
2435
});

0 commit comments

Comments
 (0)