blob: 6158065dbcf35586b41a7d925e77b20e89b666bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import { NumbersOnlyDirective } from './numbers-only.directive';
import { ElementRef, Injectable } from '@angular/core';
import { TestBed } from '@angular/core/testing';
@Injectable()
export class MockElementRef {
nativeElement: {}
}
describe('NumbersOnlyDirective', () => {
let elRef: ElementRef;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [{provide: ElementRef, useValue: new MockElementRef()}]
});
elRef = TestBed.get(ElementRef);
});
it('should create an instance', () => {
const directive = new NumbersOnlyDirective(elRef);
expect(directive).toBeTruthy();
});
});
|