import { TestBed, ComponentFixture } from "@angular/core/testing"; import { Component } from "@angular/core"; // Load the implementations that should be tested import { RowDirective } from "./row.directive"; import { By } from "@angular/platform-browser"; @Component({ template: `
`, standalone: false, }) class TestComponent {} describe("Row Directive", () => { describe("rendered tests", () => { let fixture: ComponentFixture; // provide our implementations or mocks to the dependency injector beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestComponent, RowDirective], }); fixture = TestBed.createComponent(TestComponent); }); it("Get row class value", function () { fixture.detectChanges(); const str = fixture.debugElement.query(By.css("div")); expect(str.nativeElement.getAttribute("class")).toContain("row"); }); }); });