1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01:00

[PM-13016] Browser default match detection (#11569)

* update conditional to only exit early if value is null

- The UriMatchStrategy for Domain was 0 and hitting the conditional

* add baseDomain test
This commit is contained in:
Nick Krantz 2024-10-16 08:11:41 -05:00 committed by GitHub
parent 34e2d3dad2
commit d8f1527db0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -58,6 +58,13 @@ describe("UriOptionComponent", () => {
expect(component["uriMatchOptions"][0].label).toBe("default");
});
it("should update the default uri match strategy label when it is domain", () => {
component.defaultMatchDetection = UriMatchStrategy.Domain;
fixture.detectChanges();
expect(component["uriMatchOptions"][0].label).toBe("defaultLabel baseDomain");
});
it("should update the default uri match strategy label", () => {
component.defaultMatchDetection = UriMatchStrategy.Exact;
fixture.detectChanges();

View File

@ -84,7 +84,7 @@ export class UriOptionComponent implements ControlValueAccessor {
@Input({ required: true })
set defaultMatchDetection(value: UriMatchStrategySetting) {
// The default selection has a value of `null` avoid showing "Default (Default)"
if (!value) {
if (value === null) {
return;
}