mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-27 22:11:38 +01:00
fix broken blockedInteractionsUris state contruction (#12813)
This commit is contained in:
parent
22f4822efc
commit
fb4d7e8f05
@ -63,7 +63,7 @@ describe("ScriptInjectorService", () => {
|
|||||||
configService.getFeatureFlag$.mockImplementation(() => of(false));
|
configService.getFeatureFlag$.mockImplementation(() => of(false));
|
||||||
domainSettingsService = new DefaultDomainSettingsService(fakeStateProvider, configService);
|
domainSettingsService = new DefaultDomainSettingsService(fakeStateProvider, configService);
|
||||||
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
|
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
|
||||||
domainSettingsService.blockedInteractionsUris$ = of(null);
|
domainSettingsService.blockedInteractionsUris$ = of({});
|
||||||
scriptInjectorService = new BrowserScriptInjectorService(
|
scriptInjectorService = new BrowserScriptInjectorService(
|
||||||
domainSettingsService,
|
domainSettingsService,
|
||||||
platformUtilsService,
|
platformUtilsService,
|
||||||
|
@ -39,7 +39,7 @@ describe("FilelessImporterBackground ", () => {
|
|||||||
let tabMock: chrome.tabs.Tab;
|
let tabMock: chrome.tabs.Tab;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
domainSettingsService.blockedInteractionsUris$ = of(null);
|
domainSettingsService.blockedInteractionsUris$ = of({});
|
||||||
policyService.policyAppliesToActiveUser$.mockImplementation(() => of(true));
|
policyService.policyAppliesToActiveUser$.mockImplementation(() => of(true));
|
||||||
scriptInjectorService = new BrowserScriptInjectorService(
|
scriptInjectorService = new BrowserScriptInjectorService(
|
||||||
domainSettingsService,
|
domainSettingsService,
|
||||||
|
@ -29,7 +29,7 @@ describe("DefaultDomainSettingsService", () => {
|
|||||||
|
|
||||||
jest.spyOn(domainSettingsService, "getUrlEquivalentDomains");
|
jest.spyOn(domainSettingsService, "getUrlEquivalentDomains");
|
||||||
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
|
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
|
||||||
domainSettingsService.blockedInteractionsUris$ = of(null);
|
domainSettingsService.blockedInteractionsUris$ = of({});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("getUrlEquivalentDomains", () => {
|
describe("getUrlEquivalentDomains", () => {
|
||||||
|
@ -36,7 +36,7 @@ const BLOCKED_INTERACTIONS_URIS = new KeyDefinition(
|
|||||||
DOMAIN_SETTINGS_DISK,
|
DOMAIN_SETTINGS_DISK,
|
||||||
"blockedInteractionsUris",
|
"blockedInteractionsUris",
|
||||||
{
|
{
|
||||||
deserializer: (value: NeverDomains) => value ?? null,
|
deserializer: (value: NeverDomains) => value ?? {},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ export class DefaultDomainSettingsService implements DomainSettingsService {
|
|||||||
switchMap((featureIsEnabled) =>
|
switchMap((featureIsEnabled) =>
|
||||||
featureIsEnabled ? this.blockedInteractionsUrisState.state$ : of({} as NeverDomains),
|
featureIsEnabled ? this.blockedInteractionsUrisState.state$ : of({} as NeverDomains),
|
||||||
),
|
),
|
||||||
map((disabledUris) => (Object.keys(disabledUris).length ? disabledUris : null)),
|
map((disabledUris) => (Object.keys(disabledUris).length ? disabledUris : {})),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.equivalentDomainsState = this.stateProvider.getActive(EQUIVALENT_DOMAINS);
|
this.equivalentDomainsState = this.stateProvider.getActive(EQUIVALENT_DOMAINS);
|
||||||
|
Loading…
Reference in New Issue
Block a user