import { TestBed, ComponentFixture } from "@angular/core/testing"; import { Component, TemplateRef } from "@angular/core"; import { DynamicTemplateDirective, DYNAMIC_TEMPLATE_DIRECTIVE_ALIGNMENT } from "./dynamic-template.directive"; @Component({ template: ` ` }) class TestComponent { } describe("DynamicTemplateDirective test suite", () => { let directive: DynamicTemplateDirective, fixture: ComponentFixture; beforeEach(() => { directive = new DynamicTemplateDirective({} as TemplateRef); fixture = TestBed.configureTestingModule({ declarations: [DynamicTemplateDirective, TestComponent] }).createComponent(TestComponent); fixture.detectChanges(); }); it("should be initialized correctly", () => { expect(directive.align === DYNAMIC_TEMPLATE_DIRECTIVE_ALIGNMENT.End).toBe(true); expect(directive.as).toBeNull(); expect(directive.modelId).toBeUndefined(); expect(directive.modelType).toBeUndefined(); }); });