mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
add simple config util test
This commit is contained in:
17
src/config/config.util.spec.ts
Normal file
17
src/config/config.util.spec.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { environment } from '../environments/environment.prod';
|
||||||
|
import { extendEnvironmentWithAppConfig } from './config.util';
|
||||||
|
import { DefaultAppConfig } from './default-app-config';
|
||||||
|
|
||||||
|
describe('Config Util', () => {
|
||||||
|
describe('extendEnvironmentWithAppConfig', () => {
|
||||||
|
it('should extend prod environment with app config', () => {
|
||||||
|
const appConfig = new DefaultAppConfig();
|
||||||
|
const originalMsToLive = appConfig.cache.msToLive.default;
|
||||||
|
expect(originalMsToLive).toEqual(15 * 60 * 1000); // 15 minute
|
||||||
|
const msToLive = 1 * 60 * 1000; // 1 minute
|
||||||
|
appConfig.cache.msToLive.default = msToLive;
|
||||||
|
extendEnvironmentWithAppConfig(environment, appConfig);
|
||||||
|
expect(environment.cache.msToLive.default).toEqual(msToLive);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Reference in New Issue
Block a user