mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
Auth/PM-13114 - WebEnvService Refactor + Unit Tests to support QA Env Selector (#11397)
* PM-13114 - WebEnvSvc - use hostname vs domain check for init and setEnv (tests TODO) * PM-13114 - WebEnvSvc + URLs webpack config - use expected string variable on process.env.URLS to ensure tests can properly mock the WebEnvSvc * PM-13114 - WebEnvSvc - setEnvironment - fix issue with returning currentRegion urls instead of currentEnv urls. * PM-13114 - WebEnvSvc - setEnv - refactor names to improve clarity. * PM-13114 - WebEnvSvc spec file - Test all prod scenarios * PM-13144 - Work with Justin to move process.env.Urls access into injection token and remove webpack string type conversion. * PM-13114 - WIP on getting additionalRegionConfigs injected via injection token to default env service. * PM-13114 - Update all background inits to pass process.env.ADDITIONAL_REGIONS as unknown as RegionConfig[] to env service. * PM-13114 - WebEnvSvc - adjust order of constructor deps * PM-13114 - WebEnvSvc - add WebRegionConfig to extend RegionConfig type and be accurate for what the WebEnvSvc uses. * PM-13114 - WebEnvSvc Tests - US QA tested * PM-13114 - WebEnvSvc tests - refactor QA naming to make it more clear. * PM-13114 - WebEnvSvc - test QA EU * PM-13114 - WebEnvSvc - remove promise resolve per PR feedback.
This commit is contained in:
@@ -136,6 +136,7 @@ export class DefaultEnvironmentService implements EnvironmentService {
|
||||
constructor(
|
||||
private stateProvider: StateProvider,
|
||||
private accountService: AccountService,
|
||||
private additionalRegionConfigs: RegionConfig[] = [],
|
||||
) {
|
||||
this.globalState = this.stateProvider.getGlobal(GLOBAL_ENVIRONMENT_KEY);
|
||||
this.globalCloudRegionState = this.stateProvider.getGlobal(GLOBAL_CLOUD_REGION_KEY);
|
||||
@@ -177,8 +178,7 @@ export class DefaultEnvironmentService implements EnvironmentService {
|
||||
}
|
||||
|
||||
availableRegions(): RegionConfig[] {
|
||||
const additionalRegions = (process.env.ADDITIONAL_REGIONS as unknown as RegionConfig[]) ?? [];
|
||||
return PRODUCTION_REGIONS.concat(additionalRegions);
|
||||
return PRODUCTION_REGIONS.concat(this.additionalRegionConfigs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user