|
|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
import { Component, LOCALE_ID } from '@angular/core';
|
|
|
|
|
import { createRoutingFactory, SpectatorHost, SpectatorRouting } from '@ngneat/spectator/jest';
|
|
|
|
|
import { createRoutingFactory, SpectatorRouting } from '@ngneat/spectator/jest';
|
|
|
|
|
import { differentLocales } from '../constants/different-locales';
|
|
|
|
|
import { LocaleId } from '../providers';
|
|
|
|
|
import { LocalizationService } from '../services';
|
|
|
|
|
import { LocaleProvider, LocaleId } from '../providers';
|
|
|
|
|
import localesMapping from '../constants/different-locales';
|
|
|
|
|
|
|
|
|
|
@Component({ selector: 'abp-dummy', template: '' })
|
|
|
|
|
export class DummyComponent {}
|
|
|
|
|
@ -28,10 +28,10 @@ describe('LocaleProvider', () => {
|
|
|
|
|
spectator = createComponent();
|
|
|
|
|
const localizationService = spectator.inject(LocalizationService);
|
|
|
|
|
|
|
|
|
|
expect(spectator.inject(LOCALE_ID).valueOf()).toBe(localesMapping['en-US'] || 'en-US');
|
|
|
|
|
expect(spectator.inject(LOCALE_ID).valueOf()).toBe(differentLocales['en-US'] || 'en-US');
|
|
|
|
|
|
|
|
|
|
(localizationService as any).currentLang = 'tr';
|
|
|
|
|
expect(spectator.inject(LOCALE_ID).valueOf()).toBe(localesMapping['tr'] || 'tr');
|
|
|
|
|
expect(spectator.inject(LOCALE_ID).valueOf()).toBe(differentLocales['tr'] || 'tr');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|