1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-02 11:31:44 +00:00

[CL-525] Upgrade angular to v19 (#14815)

Upgrade Angular to v19 using the update guide.

- Add `standalone: false` to any missed component in stories or tests.
- Update jest.config to follow the new best practices.
This commit is contained in:
Oscar Hinton
2025-06-02 19:13:31 +02:00
committed by GitHub
parent 6bb484dc23
commit 2fbc4c1578
61 changed files with 2827 additions and 3690 deletions

View File

@@ -85,6 +85,7 @@ describe("Button", () => {
<button id="disabled" type="button" bitButton disabled>Button</button>
`,
standalone: false,
})
class TestApp {
buttonType: string;

View File

@@ -20,6 +20,7 @@ interface Animal {
@Component({
template: `<button bitButton type="button" (click)="openDialog()">Open Dialog</button>`,
standalone: false,
})
class StoryDialogComponent {
constructor(public dialogService: DialogService) {}
@@ -49,6 +50,7 @@ class StoryDialogComponent {
</ng-container>
</bit-dialog>
`,
standalone: false,
})
class StoryDialogContentComponent {
constructor(

View File

@@ -31,6 +31,7 @@ import { DialogModule } from "../../dialog.module";
</bit-callout>
}
`,
standalone: false,
})
class StoryDialogComponent {
protected dialogs: { title: string; dialogs: SimpleDialogOptions[] }[] = [

View File

@@ -18,6 +18,7 @@ interface Animal {
@Component({
template: `<button type="button" bitButton (click)="openDialog()">Open Simple Dialog</button>`,
standalone: false,
})
class StoryDialogComponent {
constructor(public dialogService: DialogService) {}
@@ -48,6 +49,7 @@ class StoryDialogComponent {
</ng-container>
</bit-simple-dialog>
`,
standalone: false,
})
class StoryDialogContentComponent {
constructor(

View File

@@ -25,6 +25,7 @@ import { BitPasswordInputToggleDirective } from "./password-input-toggle.directi
</bit-form-field>
</form>
`,
standalone: false,
})
class TestFormFieldComponent {}

View File

@@ -73,5 +73,6 @@ describe("Menu", () => {
<a id="item2" bitMenuItem>Item 2</a>
</bit-menu>
`,
standalone: false,
})
class TestApp {}

View File

@@ -71,12 +71,13 @@ describe("RadioButton", () => {
class MockedButtonGroupComponent implements Partial<RadioGroupComponent> {
onInputChange = jest.fn();
selected = null;
selected: unknown = null;
}
@Component({
selector: "test-app",
template: ` <bit-radio-button [value]="value"><bit-label>Element</bit-label></bit-radio-button>`,
template: `<bit-radio-button [value]="value"><bit-label>Element</bit-label></bit-radio-button>`,
standalone: false,
})
class TestApp {
value?: string;

View File

@@ -75,6 +75,7 @@ describe("RadioGroupComponent", () => {
<bit-radio-button value="third">Third</bit-radio-button>
</bit-radio-group>
`,
standalone: false,
})
class TestApp {
selected?: string;

View File

@@ -10,7 +10,7 @@ import { ToggleComponent } from "./toggle.component";
describe("Button", () => {
let fixture: ComponentFixture<TestApp>;
let testAppComponent: TestApp;
let buttonElements: ToggleComponent[];
let buttonElements: ToggleComponent<unknown>[];
let radioButtons: HTMLInputElement[];
beforeEach(waitForAsync(() => {
@@ -67,6 +67,7 @@ describe("Button", () => {
<bit-toggle value="third">Third</bit-toggle>
</bit-toggle-group>
`,
standalone: false,
})
class TestApp {
selected?: string;

View File

@@ -63,12 +63,13 @@ describe("Button", () => {
class MockedButtonGroupComponent implements Partial<ToggleGroupComponent> {
onInputInteraction = jest.fn();
selected = null;
selected: unknown = null;
}
@Component({
selector: "test-app",
template: ` <bit-toggle [value]="value">Element</bit-toggle>`,
standalone: false,
})
class TestApp {
value?: string;