Files
angular/packages/core/test/application_module_spec.ts
Kristiyan Kostadinov 38816151b8 fix(core): race condition when setting locale
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.
2026-10-14 12:35:58 +02:00

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');
});
});