mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4342] Create localized pipe and centralize date format (#4813)
* [ADF-4342] Date Format defined in app config * [ADF-4342] Create localized pipe and centralize date format * Add unit test for new date pipe * Add info internationalization docs * Fix lining * Fix linting * Fix date pipe unit test * [ADF-4342] Add supported language files * Fix e2e tests
This commit is contained in:
committed by
Denys Vuika
parent
990fa4625b
commit
7497822a46
@@ -16,14 +16,26 @@
|
||||
*/
|
||||
|
||||
import { TimeAgoPipe } from './time-ago.pipe';
|
||||
import { async } from '@angular/core/testing';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { UserPreferencesService } from '../services/user-preferences.service';
|
||||
import { setupTestBed } from '../testing/setupTestBed';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('TimeAgoPipe', () => {
|
||||
|
||||
let pipe: TimeAgoPipe;
|
||||
let userPreferences: UserPreferencesService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
pipe = new TimeAgoPipe();
|
||||
userPreferences = TestBed.get(UserPreferencesService);
|
||||
spyOn(userPreferences, 'select').and.returnValue(of(''));
|
||||
pipe = new TimeAgoPipe(userPreferences, new AppConfigService(null));
|
||||
}));
|
||||
|
||||
it('should return time difference for a given date', () => {
|
||||
|
Reference in New Issue
Block a user