mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[NO-ISSUE] Fix e2e test (#4621)
* fix sso, change timeout, parallel * cange travis * move name apps in resources file * resources fix * resources fix * add sleep before search group * add possibility to extend duration of snack-bar message from configuration * fix unit test * fix unit test * remove timeout * change timeout * decrease message time * add lint main branch travis * reduce timeout * add new check application presence * change permission script fix search selector * fix travis conf * check app environment and upload the app if abbsent * fix cloud test * remove duplicate * restore ps test * restore resources file * fix e2e test * process with variables missing * test new conf travis * fix lint * fix spellcheck * remove duplicate module * fix ps module * fix travis conf * change check activiti env * add concept of processes in resources
This commit is contained in:
@@ -38,7 +38,8 @@ export enum AppConfigValues {
|
||||
LOGIN_ROUTE = 'loginRoute',
|
||||
DISABLECSRF = 'disableCSRF',
|
||||
AUTH_WITH_CREDENTIALS = 'auth.withCredentials',
|
||||
APPLICATION = 'application'
|
||||
APPLICATION = 'application',
|
||||
NOTIFY_DURATION = 'notificationDefaultDuration'
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
|
@@ -21,6 +21,11 @@ import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ClipboardModule } from './clipboard.module';
|
||||
import { ClipboardService } from './clipboard.service';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { MatSnackBarModule } from '@angular/material';
|
||||
import { TranslationMock } from '@alfresco/adf-core';
|
||||
|
||||
describe('ClipboardService', () => {
|
||||
let clipboardService: ClipboardService;
|
||||
@@ -30,20 +35,15 @@ describe('ClipboardService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
ClipboardModule
|
||||
ClipboardModule,
|
||||
HttpClientModule,
|
||||
MatSnackBarModule
|
||||
],
|
||||
providers: [
|
||||
LogService,
|
||||
NotificationService,
|
||||
{
|
||||
provide: AppConfigService,
|
||||
useValue: new AppConfigService(null)
|
||||
|
||||
},
|
||||
{
|
||||
provide: NotificationService,
|
||||
useValue: new NotificationService(null, null)
|
||||
}
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
NotificationService
|
||||
]
|
||||
});
|
||||
});
|
||||
|
@@ -25,6 +25,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { NotificationService } from './notification.service';
|
||||
import { TranslationMock } from '../mock/translation.service.mock';
|
||||
import { TranslationService } from './translation.service';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
template: '',
|
||||
@@ -76,7 +77,8 @@ describe('NotificationService', () => {
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
OverlayModule,
|
||||
MatSnackBarModule
|
||||
MatSnackBarModule,
|
||||
HttpClientModule
|
||||
],
|
||||
declarations: [ProvidesNotificationServiceComponent],
|
||||
providers: [
|
||||
|
@@ -18,16 +18,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatSnackBar, MatSnackBarRef, MatSnackBarConfig } from '@angular/material';
|
||||
import { TranslationService } from './translation.service';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationService {
|
||||
|
||||
static DEFAULT_DURATION_MESSAGE: number = 5000;
|
||||
DEFAULT_DURATION_MESSAGE: number = 5000;
|
||||
|
||||
constructor(private snackBar: MatSnackBar,
|
||||
private translationService: TranslationService) {
|
||||
private translationService: TranslationService,
|
||||
private appConfigService: AppConfigService) {
|
||||
this.DEFAULT_DURATION_MESSAGE = this.appConfigService.get<number>(AppConfigValues.NOTIFY_DURATION) || this.DEFAULT_DURATION_MESSAGE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,7 +40,10 @@ export class NotificationService {
|
||||
* @param config Time before notification disappears after being shown or MatSnackBarConfig object
|
||||
* @returns Information/control object for the SnackBar
|
||||
*/
|
||||
openSnackMessage(message: string, config: number | MatSnackBarConfig = NotificationService.DEFAULT_DURATION_MESSAGE): MatSnackBarRef<any> {
|
||||
openSnackMessage(message: string, config?: number | MatSnackBarConfig): MatSnackBarRef<any> {
|
||||
if (!config) {
|
||||
config = this.DEFAULT_DURATION_MESSAGE;
|
||||
}
|
||||
|
||||
const translatedMessage = this.translationService.instant(message);
|
||||
|
||||
@@ -56,7 +63,10 @@ export class NotificationService {
|
||||
* @param config Time before notification disappears after being shown or MatSnackBarConfig object
|
||||
* @returns Information/control object for the SnackBar
|
||||
*/
|
||||
openSnackMessageAction(message: string, action: string, config: number | MatSnackBarConfig = NotificationService.DEFAULT_DURATION_MESSAGE): MatSnackBarRef<any> {
|
||||
openSnackMessageAction(message: string, action: string, config?: number | MatSnackBarConfig): MatSnackBarRef<any> {
|
||||
if (!config) {
|
||||
config = this.DEFAULT_DURATION_MESSAGE;
|
||||
}
|
||||
|
||||
const translatedMessage = this.translationService.instant(message);
|
||||
|
||||
|
Reference in New Issue
Block a user