mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Migrate remaining components to standalone in libs/components (#15053)
Migrates the remaining non standalone components from libs/components. Also resolved some linting ignores and applying strict typescript.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { Component } from "@angular/core";
|
||||
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
|
||||
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
||||
import { By } from "@angular/platform-browser";
|
||||
|
||||
import { ToggleGroupComponent } from "./toggle-group.component";
|
||||
@@ -13,22 +11,19 @@ describe("Button", () => {
|
||||
let testAppComponent: TestApp;
|
||||
let radioButton: HTMLInputElement;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
beforeEach(async () => {
|
||||
mockGroupComponent = new MockedButtonGroupComponent();
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ToggleGroupModule],
|
||||
declarations: [TestApp],
|
||||
imports: [TestApp],
|
||||
providers: [{ provide: ToggleGroupComponent, useValue: mockGroupComponent }],
|
||||
});
|
||||
|
||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
TestBed.compileComponents();
|
||||
await TestBed.compileComponents();
|
||||
fixture = TestBed.createComponent(TestApp);
|
||||
testAppComponent = fixture.debugElement.componentInstance;
|
||||
radioButton = fixture.debugElement.query(By.css("input[type=radio]")).nativeElement;
|
||||
}));
|
||||
});
|
||||
|
||||
it("should emit value when clicking on radio button", () => {
|
||||
testAppComponent.value = "value";
|
||||
@@ -69,7 +64,7 @@ class MockedButtonGroupComponent implements Partial<ToggleGroupComponent> {
|
||||
@Component({
|
||||
selector: "test-app",
|
||||
template: ` <bit-toggle [value]="value">Element</bit-toggle>`,
|
||||
standalone: false,
|
||||
imports: [ToggleGroupModule],
|
||||
})
|
||||
class TestApp {
|
||||
value?: string;
|
||||
|
||||
Reference in New Issue
Block a user