1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 09:33:27 +00:00

[PM-28231] Enable component-class-suffix (#17384)

* Enable component-class-suffix

* Rename file
This commit is contained in:
Oscar Hinton
2025-11-18 13:26:38 +01:00
committed by GitHub
parent 8f04f25818
commit 9efc31534b
38 changed files with 111 additions and 88 deletions

View File

@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from "@angular/core/testing";
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from "@angular/forms";
import { By } from "@angular/platform-browser";
import { BitLabel } from "../form-control/label.component";
import { BitLabelComponent } from "../form-control/label.component";
import { SwitchComponent } from "./switch.component";
@@ -16,7 +16,7 @@ describe("SwitchComponent", () => {
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "test-host",
imports: [FormsModule, BitLabel, ReactiveFormsModule, SwitchComponent],
imports: [FormsModule, BitLabelComponent, ReactiveFormsModule, SwitchComponent],
template: `
<form [formGroup]="formObj">
<bit-switch formControlName="switch">
@@ -77,7 +77,7 @@ describe("SwitchComponent", () => {
selector: "test-selected-host",
template: `<bit-switch [selected]="checked"><bit-label>Element</bit-label></bit-switch>`,
standalone: true,
imports: [SwitchComponent, BitLabel],
imports: [SwitchComponent, BitLabelComponent],
})
class TestSelectedHostComponent {
checked = false;

View File

@@ -14,7 +14,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
import { AriaDisableDirective } from "../a11y";
import { FormControlModule } from "../form-control/form-control.module";
import { BitHintComponent } from "../form-control/hint.component";
import { BitLabel } from "../form-control/label.component";
import { BitLabelComponent } from "../form-control/label.component";
let nextId = 0;
@@ -43,7 +43,7 @@ let nextId = 0;
})
export class SwitchComponent implements ControlValueAccessor, AfterViewInit {
private el = inject(ElementRef<HTMLButtonElement>);
private readonly label = contentChild.required(BitLabel);
private readonly label = contentChild.required(BitLabelComponent);
/**
* Model signal for selected state binding when used outside of a form