[ADF-3384] Create automated tests for Version Component (#3631)

* fix version component restore and delete event

* version manager actions

* fix test

* fix unit test

* remove fdescribe

* fix tslint

* fix screenshot rewrite problem

* remove fdescribe

* multi instance try

* remove fdescribe

* try uncomment some test

* error page

* fix user preferences pagiantion

* search page test include

* fix type tslint e2e

* restore code

* default lang momentadapter

* fix test

* [ADF-3384] removed console log from test

* [ADF-3384] adding some fixes for tests and code

* [ADF-3384] fixed some test and code
This commit is contained in:
Eugenio Romano
2018-08-03 18:12:03 +01:00
committed by Eugenio Romano
parent 17074478e2
commit a12662e7e2
101 changed files with 2047 additions and 718 deletions

View File

@@ -53,7 +53,7 @@ export class UserPreferencesService {
private appConfig: AppConfigService,
private storage: StorageService) {
this.appConfig.onLoad.subscribe(this.initUserPreferenceStatus.bind(this));
this.localeSubject = new BehaviorSubject(this.userPreferenceStatus[UserPreferenceValues.Locale]);
this.localeSubject = new BehaviorSubject(this.get(UserPreferenceValues.Locale, this.getDefaultLocale()));
this.locale$ = this.localeSubject.asObservable();
this.onChangeSubject = new BehaviorSubject(this.userPreferenceStatus);
this.onChange = this.onChangeSubject.asObservable();
@@ -61,8 +61,7 @@ export class UserPreferencesService {
private initUserPreferenceStatus() {
this.userPreferenceStatus[UserPreferenceValues.Locale] = this.locale || this.getDefaultLocale();
this.userPreferenceStatus[UserPreferenceValues.PaginationSize] = this.paginationSize ?
this.paginationSize : this.appConfig.get('pagination.size', this.defaults.paginationSize);
this.userPreferenceStatus[UserPreferenceValues.PaginationSize] = this.appConfig.get('pagination.size', this.defaults.paginationSize);
this.userPreferenceStatus[UserPreferenceValues.SupportedPageSizes] = this.appConfig.get('pagination.supportedPageSizes', this.defaults.supportedPageSizes);
}
@@ -150,27 +149,27 @@ export class UserPreferencesService {
* @returns Array of page size values
*/
getDefaultPageSizes(): number[] {
return this.defaults.supportedPageSizes;
return this.userPreferenceStatus[UserPreferenceValues.SupportedPageSizes];
}
/** Pagination size. */
set paginationSize(value: number) {
this.set('PAGINATION_SIZE', value);
this.set(UserPreferenceValues.PaginationSize, value);
}
get paginationSize(): number {
return Number(this.get('PAGINATION_SIZE')) || this.defaults.paginationSize;
return Number(this.get(UserPreferenceValues.PaginationSize, this.userPreferenceStatus[UserPreferenceValues.PaginationSize])) || this.defaults.paginationSize;
}
/** Current locale setting. */
get locale(): string {
const locale = this.get('LOCALE');
const locale = this.get(UserPreferenceValues.Locale, this.userPreferenceStatus[UserPreferenceValues.Locale]);
return locale;
}
set locale(value: string) {
this.localeSubject.next(value);
this.set('LOCALE', value);
this.set(UserPreferenceValues.Locale, value);
}
/**