From 34e46b32cca6177585eb83d5fe0ae26accfac489 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sat, 17 Sep 2016 20:24:44 +0100 Subject: [PATCH] fix unit tests --- .../src/components/alfresco-login.component.spec.ts | 4 +++- .../alfresco-search-autocomplete.component.spec.ts | 5 ++++- .../components/alfresco-search-control.component.spec.ts | 6 ++++-- .../src/components/alfresco-search.component.spec.ts | 5 ++++- .../src/components/file-uploading-dialog.component.spec.ts | 5 ++++- .../src/components/upload-button.component.spec.ts | 5 ++++- .../src/components/upload-drag-area.component.spec.ts | 4 +++- .../ng2-alfresco-webscript/src/webscript.component.spec.ts | 6 ++++-- 8 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts index 25a0314cca..19511f8e99 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts @@ -23,7 +23,8 @@ import { beforeEach, beforeEachProviders } from '@angular/core/testing'; -import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core'; +import { PLATFORM_PIPES } from '@angular/core'; +import { AlfrescoAuthenticationService, AlfrescoSettingsService, AlfrescoPipeTranslate } from 'ng2-alfresco-core'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { AlfrescoLoginComponent } from './alfresco-login.component'; @@ -37,6 +38,7 @@ describe('AlfrescoLogin', () => { beforeEachProviders(() => { return [ + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, { provide: AlfrescoAuthenticationService, useClass: AuthenticationMock }, AlfrescoSettingsService, { provide: AlfrescoTranslationService, useClass: TranslationMock } diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts index 469e1df428..f347e9ae8f 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts @@ -16,6 +16,7 @@ */ import { it, describe, expect, inject, beforeEachProviders, beforeEach, afterEach } from '@angular/core/testing'; +import { PLATFORM_PIPES } from '@angular/core'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { AlfrescoSearchAutocompleteComponent } from './alfresco-search-autocomplete.component'; import { AlfrescoThumbnailService } from './../services/alfresco-thumbnail.service'; @@ -26,7 +27,8 @@ import { AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoContentService, - AlfrescoTranslationService + AlfrescoTranslationService, + AlfrescoPipeTranslate } from 'ng2-alfresco-core'; declare let jasmine: any; @@ -66,6 +68,7 @@ describe('AlfrescoSearchAutocompleteComponent', () => { beforeEachProviders(() => { return [ + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, {provide: AlfrescoTranslationService, useClass: TranslationMock}, AlfrescoThumbnailService, AlfrescoSettingsService, diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts index f06af22be2..11502d6abd 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { provide } from '@angular/core'; +import { provide, PLATFORM_PIPES } from '@angular/core'; import { it, describe, expect, inject, beforeEachProviders, beforeEach } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { AlfrescoSearchControlComponent } from './alfresco-search-control.component'; @@ -26,7 +26,8 @@ import { AlfrescoApiService, AlfrescoAuthenticationService, AlfrescoContentService, - AlfrescoTranslationService + AlfrescoTranslationService, + AlfrescoPipeTranslate } from 'ng2-alfresco-core'; import { AlfrescoSearchService } from '../services/alfresco-search.service'; @@ -37,6 +38,7 @@ describe('AlfrescoSearchControlComponent', () => { beforeEachProviders(() => { return [ + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, AlfrescoSearchService, provide(AlfrescoTranslationService, {useClass: TranslationMock}), AlfrescoThumbnailService, diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts index 7bacf0a944..3a6ce7f465 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { PLATFORM_PIPES } from '@angular/core'; import { it, describe, expect, inject, beforeEachProviders, beforeEach } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { RouteParams } from '@angular/router-deprecated'; @@ -27,7 +28,8 @@ import { AlfrescoApiService, AlfrescoAuthenticationService, AlfrescoContentService, - AlfrescoTranslationService + AlfrescoTranslationService, + AlfrescoPipeTranslate } from 'ng2-alfresco-core'; declare let jasmine: any; @@ -67,6 +69,7 @@ describe('AlfrescoSearchComponent', () => { beforeEachProviders(() => { return [ + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, AlfrescoSearchService, {provide: AlfrescoTranslationService, useClass: TranslationMock}, AlfrescoThumbnailService, diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.spec.ts b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.spec.ts index 5323da124d..ec5ba8c8d7 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.spec.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.spec.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { PLATFORM_PIPES } from '@angular/core'; import { describe, expect, it, inject, beforeEach, beforeEachProviders } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { Observable } from 'rxjs/Observable'; @@ -24,7 +25,8 @@ import { AlfrescoTranslationService, AlfrescoSettingsService, AlfrescoAuthenticationService, - AlfrescoApiService + AlfrescoApiService, + AlfrescoPipeTranslate } from 'ng2-alfresco-core'; import { FileUploadingDialogComponent } from './file-uploading-dialog.component'; @@ -43,6 +45,7 @@ describe('FileUploadDialog', () => { AlfrescoApiService, AlfrescoSettingsService, AlfrescoAuthenticationService, + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, { provide: AlfrescoTranslationService, useClass: TranslationMock }, UploadService ]; diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.spec.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.spec.ts index ad311a00ba..1d94a8cd99 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.spec.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.spec.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { PLATFORM_PIPES } from '@angular/core'; import { describe, expect, it, inject, beforeEach, beforeEachProviders } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { HTTP_PROVIDERS } from '@angular/http'; @@ -23,7 +24,8 @@ import { AlfrescoTranslationService, AlfrescoSettingsService, AlfrescoAuthenticationService, - AlfrescoApiService + AlfrescoApiService, + AlfrescoPipeTranslate } from 'ng2-alfresco-core'; import { UploadButtonComponent } from './upload-button.component'; @@ -79,6 +81,7 @@ describe('AlfrescoUploadButton', () => { AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoApiService, + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, { provide: AlfrescoTranslationService, useClass: TranslationMock }, UploadService ]; diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.spec.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.spec.ts index c4c79ae0ec..b8406f15bc 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.spec.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.spec.ts @@ -15,10 +15,11 @@ * limitations under the License. */ +import { PLATFORM_PIPES } from '@angular/core'; import { describe, expect, it, inject, beforeEach, beforeEachProviders } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { UploadDragAreaComponent } from './upload-drag-area.component'; -import { AlfrescoTranslationService, AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoApiService } from 'ng2-alfresco-core'; +import { AlfrescoTranslationService, AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoApiService, AlfrescoPipeTranslate } from 'ng2-alfresco-core'; import { TranslationMock } from '../assets/translation.service.mock'; import { UploadService } from '../services/upload.service'; import { HTTP_PROVIDERS } from '@angular/http'; @@ -40,6 +41,7 @@ describe('AlfrescoUploadDragArea', () => { AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoApiService, + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, { provide: AlfrescoTranslationService, useClass: TranslationMock }, UploadService ]; diff --git a/ng2-components/ng2-alfresco-webscript/src/webscript.component.spec.ts b/ng2-components/ng2-alfresco-webscript/src/webscript.component.spec.ts index cc1f075140..073870237c 100644 --- a/ng2-components/ng2-alfresco-webscript/src/webscript.component.spec.ts +++ b/ng2-components/ng2-alfresco-webscript/src/webscript.component.spec.ts @@ -15,10 +15,11 @@ * limitations under the License. */ +import { PLATFORM_PIPES } from '@angular/core'; import { describe, expect, it, inject, beforeEachProviders, beforeEach, afterEach, xit } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import { WebscriptComponent } from '../src/webscript.component'; -import { AlfrescoAuthenticationService, AlfrescoSettingsService, AlfrescoApiService } from 'ng2-alfresco-core'; +import { AlfrescoAuthenticationService, AlfrescoSettingsService, AlfrescoApiService, AlfrescoPipeTranslate } from 'ng2-alfresco-core'; declare let jasmine: any; @@ -30,7 +31,8 @@ describe('Test ng2-alfresco-webscript', () => { return [ AlfrescoSettingsService, AlfrescoAuthenticationService, - AlfrescoApiService + AlfrescoApiService, + { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true } ]; });