1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-18 18:33:50 +00:00

continue migrating select module

This commit is contained in:
Vicki League
2025-06-24 14:58:50 -04:00
parent bebfc4a159
commit a0a07afa41
6 changed files with 45 additions and 65 deletions

View File

@@ -1,4 +1,4 @@
import { Component } from "@angular/core";
import { Component, signal } from "@angular/core";
import { TestBed } from "@angular/core/testing";
import { FormControl, FormGroup, ReactiveFormsModule } from "@angular/forms";
import { By } from "@angular/platform-browser";
@@ -37,15 +37,15 @@ describe("Select Component", () => {
describe("initial state", () => {
it("selected option should update when items input changes", () => {
expect(select.selectedOption?.value).toBeUndefined();
expect(select.selectedOption()?.value).toBeUndefined();
select.items = [
{ label: "Apple", value: "apple" },
{ label: "Pear", value: "pear" },
{ label: "Banana", value: "banana" },
];
select.items.set([
{ label: signal("Apple"), value: signal("apple") },
{ label: signal("Pear"), value: signal("pear") },
{ label: signal("Banana"), value: signal("banana") },
]);
expect(select.selectedOption?.value).toBe("apple");
expect(select.selectedOption()?.value).toBe("apple");
});
});
});