mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
[PM-26182] - [Defect] [Browser] Safari - Autofill on page load default setting is missing yes or no (#16605)
* handle parenthesis translation * add whitespace around placeholder with parentheses * fix test * fix label * fix spec
This commit is contained in:
@@ -201,12 +201,12 @@ describe("AutofillOptionsComponent", () => {
|
||||
|
||||
it("updates the default autofill on page load label", () => {
|
||||
fixture.detectChanges();
|
||||
expect(component["autofillOptions"][0].label).toEqual("defaultLabel no");
|
||||
expect(component["autofillOptions"][0].label).toEqual("defaultLabelWithValue no");
|
||||
|
||||
(autofillSettingsService.autofillOnPageLoadDefault$ as BehaviorSubject<boolean>).next(true);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component["autofillOptions"][0].label).toEqual("defaultLabel yes");
|
||||
expect(component["autofillOptions"][0].label).toEqual("defaultLabelWithValue yes");
|
||||
});
|
||||
|
||||
it("hides the autofill on page load field when the setting is disabled", () => {
|
||||
|
||||
@@ -218,7 +218,10 @@ export class AutofillOptionsComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
this.autofillOptions[0].label = this.i18nService.t("defaultLabel", defaultOption.label);
|
||||
this.autofillOptions[0].label = this.i18nService.t(
|
||||
"defaultLabelWithValue",
|
||||
defaultOption.label,
|
||||
);
|
||||
// Trigger change detection to update the label in the template
|
||||
this.autofillOptions = [...this.autofillOptions];
|
||||
});
|
||||
|
||||
@@ -77,19 +77,19 @@ describe("UriOptionComponent", () => {
|
||||
component.defaultMatchDetection = UriMatchStrategy.Domain;
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component["uriMatchOptions"][0].label).toBe("defaultLabel baseDomain");
|
||||
expect(component["uriMatchOptions"][0].label).toBe("defaultLabelWithValue baseDomain");
|
||||
});
|
||||
|
||||
it("should update the default uri match strategy label", () => {
|
||||
component.defaultMatchDetection = UriMatchStrategy.Exact;
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component["uriMatchOptions"][0].label).toBe("defaultLabel exact");
|
||||
expect(component["uriMatchOptions"][0].label).toBe("defaultLabelWithValue exact");
|
||||
|
||||
component.defaultMatchDetection = UriMatchStrategy.StartsWith;
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component["uriMatchOptions"][0].label).toBe("defaultLabel startsWith");
|
||||
expect(component["uriMatchOptions"][0].label).toBe("defaultLabelWithValue startsWith");
|
||||
});
|
||||
|
||||
it("should focus the uri input when focusInput is called", () => {
|
||||
|
||||
@@ -124,7 +124,7 @@ export class UriOptionComponent implements ControlValueAccessor {
|
||||
}
|
||||
|
||||
this.uriMatchOptions[0].label = this.i18nService.t(
|
||||
"defaultLabel",
|
||||
"defaultLabelWithValue",
|
||||
this.uriMatchOptions.find((o) => o.value === value)?.label,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user