Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdb2164

Browse files
committed
test(shadow-on-scroll): coverage
1 parent45c8171 commitbdb2164

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

‎projects/coreui-angular/src/lib/utilities/shadow-on-scroll.directive.spec.ts‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1-
import{ElementRef}from'@angular/core';
2-
import{TestBed}from'@angular/core/testing';
1+
import{Component,DebugElement,ElementRef}from'@angular/core';
2+
import{ComponentFixture,TestBed}from'@angular/core/testing';
33
import{ShadowOnScrollDirective}from'./shadow-on-scroll.directive';
4+
import{By}from'@angular/platform-browser';
5+
import{DOCUMENT}from'@angular/common';
6+
7+
@Component({
8+
imports:[ShadowOnScrollDirective],
9+
template:'<div cShadowOnScroll></div>'
10+
})
11+
classTestComponent{}
412

513
classMockElementRefextendsElementRef{}
614

715
describe('ShadowOnScrollDirective',()=>{
16+
letcomponent:TestComponent;
17+
letfixture:ComponentFixture<TestComponent>;
18+
letdebugElement:DebugElement;
19+
letdocument:Document;
820

921
beforeEach(()=>{
1022
TestBed.configureTestingModule({
11-
imports:[ShadowOnScrollDirective],
23+
imports:[TestComponent,ShadowOnScrollDirective],
1224
providers:[{provide:ElementRef,useClass:MockElementRef}]
13-
});
25+
}).compileComponents();
26+
27+
fixture=TestBed.createComponent(TestComponent);
28+
document=TestBed.inject(DOCUMENT);
29+
component=fixture.componentInstance;
30+
debugElement=fixture.debugElement.query(By.directive(ShadowOnScrollDirective));
31+
fixture.detectChanges();
1432
});
1533

1634
it('should create an instance',()=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp