mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-08 14:51:14 +00:00
udpate unit tests
This commit is contained in:
@@ -19,7 +19,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Component } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { MdDialogModule, MdDialog } from '@angular/material';
|
||||
import { MatDialogModule, MatDialog } from '@angular/material';
|
||||
|
||||
import { FolderCreateDirective } from './folder-create.directive';
|
||||
import { ContentManagementService } from '../services/content-management.service';
|
||||
@@ -35,7 +35,7 @@ describe('FolderCreateDirective', () => {
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
let element;
|
||||
let node: any;
|
||||
let dialog: MdDialog;
|
||||
let dialog: MatDialog;
|
||||
let contentService: ContentManagementService;
|
||||
let dialogRefMock;
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('FolderCreateDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ MdDialogModule ],
|
||||
imports: [ MatDialogModule ],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
FolderCreateDirective
|
||||
@@ -59,7 +59,7 @@ describe('FolderCreateDirective', () => {
|
||||
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
element = fixture.debugElement.query(By.directive(FolderCreateDirective));
|
||||
dialog = TestBed.get(MdDialog);
|
||||
dialog = TestBed.get(MatDialog);
|
||||
contentService = TestBed.get(ContentManagementService);
|
||||
});
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Component } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { MdDialogModule, MdDialog } from '@angular/material';
|
||||
import { MatDialogModule, MatDialog } from '@angular/material';
|
||||
|
||||
import { FolderEditDirective } from './folder-edit.directive';
|
||||
import { ContentManagementService } from '../services/content-management.service';
|
||||
@@ -35,7 +35,7 @@ describe('FolderEditDirective', () => {
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
let element;
|
||||
let node: any;
|
||||
let dialog: MdDialog;
|
||||
let dialog: MatDialog;
|
||||
let contentService: ContentManagementService;
|
||||
let dialogRefMock;
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('FolderEditDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ MdDialogModule ],
|
||||
imports: [ MatDialogModule ],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
FolderEditDirective
|
||||
@@ -59,7 +59,7 @@ describe('FolderEditDirective', () => {
|
||||
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
element = fixture.debugElement.query(By.directive(FolderEditDirective));
|
||||
dialog = TestBed.get(MdDialog);
|
||||
dialog = TestBed.get(MatDialog);
|
||||
contentService = TestBed.get(ContentManagementService);
|
||||
});
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { CoreModule, AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import { MdDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { Component, DebugElement } from '@angular/core';
|
||||
import { DownloadFileDirective } from './node-download.directive';
|
||||
|
||||
@@ -33,10 +33,9 @@ describe('DownloadFileDirective', () => {
|
||||
let component: TestComponent;
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
let element: DebugElement;
|
||||
let dialog: MdDialog;
|
||||
let dialog: MatDialog;
|
||||
let apiService: AlfrescoApiService;
|
||||
let contentService;
|
||||
let spySnackBar;
|
||||
let dialogSpy;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -56,7 +55,7 @@ describe('DownloadFileDirective', () => {
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.debugElement.query(By.directive(DownloadFileDirective));
|
||||
dialog = TestBed.get(MdDialog);
|
||||
dialog = TestBed.get(MatDialog);
|
||||
apiService = TestBed.get(AlfrescoApiService);
|
||||
contentService = apiService.getInstance().content;
|
||||
dialogSpy = spyOn(dialog, 'open');
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { TestBed, async } from '@angular/core/testing';
|
||||
import { MdDialog, OverlayModule } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { OverlayModule } from '@angular/cdk/overlay';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { CoreModule, AlfrescoApiService, NodesApiService } from 'ng2-alfresco-core';
|
||||
import { DocumentListService, NodeMinimal, NodeMinimalEntry } from 'ng2-alfresco-documentlist';
|
||||
@@ -78,7 +79,7 @@ describe('NodeActionsService', () => {
|
||||
OverlayModule
|
||||
],
|
||||
providers: [
|
||||
MdDialog,
|
||||
MatDialog,
|
||||
DocumentListService,
|
||||
AlfrescoApiService,
|
||||
NodesApiService,
|
||||
@@ -249,7 +250,7 @@ describe('NodeActionsService', () => {
|
||||
spyOn(service, 'getFirstParentId').and.returnValue('parent-id');
|
||||
|
||||
let testContentNodeSelectorComponentData;
|
||||
const dialog = TestBed.get(MdDialog);
|
||||
const dialog = TestBed.get(MatDialog);
|
||||
const spyOnDialog = spyOn(dialog, 'open').and.callFake((contentNodeSelectorComponent: any, data: any) => {
|
||||
testContentNodeSelectorComponentData = data;
|
||||
return {};
|
||||
@@ -276,7 +277,7 @@ describe('NodeActionsService', () => {
|
||||
spyOn(service, 'getFirstParentId').and.returnValue('parent-id');
|
||||
|
||||
let testContentNodeSelectorComponentData;
|
||||
const dialog = TestBed.get(MdDialog);
|
||||
const dialog = TestBed.get(MatDialog);
|
||||
spyOn(dialog, 'open').and.callFake((contentNodeSelectorComponent: any, data: any) => {
|
||||
testContentNodeSelectorComponentData = data;
|
||||
return {};
|
||||
@@ -295,7 +296,7 @@ describe('NodeActionsService', () => {
|
||||
spyOn(service, 'getFirstParentId').and.returnValue('parent-id');
|
||||
|
||||
let testContentNodeSelectorComponentData;
|
||||
const dialog = TestBed.get(MdDialog);
|
||||
const dialog = TestBed.get(MatDialog);
|
||||
spyOn(dialog, 'open').and.callFake((contentNodeSelectorComponent: any, data: any) => {
|
||||
testContentNodeSelectorComponentData = data;
|
||||
return {};
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { TestBed, async } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { MaterialModule } from '@angular/material';
|
||||
import { MaterialModule } from '../../common/material.module';
|
||||
import { CoreModule, PeopleContentService } from 'ng2-alfresco-core';
|
||||
|
||||
import { CurrentUserComponent } from './current-user.component';
|
||||
|
Reference in New Issue
Block a user