|
|
|
@ -5,7 +5,7 @@ import clone from 'just-clone'; |
|
|
|
import { BehaviorSubject } from 'rxjs'; |
|
|
|
import { FindTenantResultDto } from '../models/find-tenant-result-dto'; |
|
|
|
import { MultiTenancyService } from '../services/multi-tenancy.service'; |
|
|
|
import { getCurrentTenancyName, parseTenantFromUrl } from '../utils'; |
|
|
|
import { parseTenantFromUrl } from '../utils'; |
|
|
|
|
|
|
|
const environment = { |
|
|
|
production: false, |
|
|
|
@ -58,20 +58,6 @@ describe('MultiTenancyUtils', () => { |
|
|
|
|
|
|
|
beforeEach(() => (spectator = createComponent())); |
|
|
|
|
|
|
|
describe('#getCurrentTenancyName', () => { |
|
|
|
test('should get tenancy name from href', async () => { |
|
|
|
setHref('https://abp.volosoft.com/'); |
|
|
|
expect(getCurrentTenancyName('https://{0}.volosoft.com')).toBe('abp'); |
|
|
|
|
|
|
|
setHref('https://volosoft.com/'); |
|
|
|
expect(getCurrentTenancyName('https://{0}.com')).toBe('volosoft'); |
|
|
|
|
|
|
|
setHref('https://volosoft.com/abp/'); |
|
|
|
expect(getCurrentTenancyName('https://volosoft.com/{0}')).toBe('abp'); |
|
|
|
expect(getCurrentTenancyName('https://volosoft.com')).toBe(undefined); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('#parseTenantFromUrl', () => { |
|
|
|
test('should get the tenancyName, set replaced environment and call the findTenantByName method of MultiTenancyService', async () => { |
|
|
|
const injector = spectator.inject(Injector); |
|
|
|
|