mirror of
https://github.com/angular/angular.git
synced 2026-11-22 22:55:25 -05:00
Currently we have a global state that tracks the locale. The problem is that it is set asynchronously after a promise which makes it prone to race conditions during SSR. These changes resolve the issue by tracking the locale in the `LView` instead.
24 lines
695 B
TypeScript
24 lines
695 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
|
|
import {DEFAULT_CURRENCY_CODE, LOCALE_ID} from '../src/core';
|
|
|
|
import {TestBed} from '../testing';
|
|
|
|
describe('Application module', () => {
|
|
it('should set the default locale to "en-US"', () => {
|
|
const defaultLocale = TestBed.inject(LOCALE_ID);
|
|
expect(defaultLocale).toEqual('en-US');
|
|
});
|
|
|
|
it('should set the default currency code to "USD"', () => {
|
|
const defaultCurrencyCode = TestBed.inject(DEFAULT_CURRENCY_CODE);
|
|
expect(defaultCurrencyCode).toEqual('USD');
|
|
});
|
|
});
|