mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fixed unit test after rebase
This commit is contained in:
@@ -19,7 +19,7 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { ContentService } from './content.service';
|
||||
import { AppConfigService, AuthenticationService, RedirectAuthService, StorageService } from '@alfresco/adf-core';
|
||||
import { Node, PermissionsInfo } from '@alfresco/js-api';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('ContentService', () => {
|
||||
@@ -30,7 +30,7 @@ describe('ContentService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [ContentService, AuthenticationService, { provide: RedirectAuthService, useValue: { onLogin: EMPTY } }]
|
||||
providers: [ContentService, AuthenticationService, { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
});
|
||||
authService = TestBed.inject(AuthenticationService);
|
||||
contentService = TestBed.inject(ContentService);
|
||||
|
@@ -20,7 +20,7 @@ import { AlfrescoApiService, AlfrescoApiServiceMock, RedirectAuthService } from
|
||||
import { PeopleContentQueryRequestModel, PeopleContentService } from './people-content.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
|
||||
describe('PeopleContentService', () => {
|
||||
let peopleContentService: PeopleContentService;
|
||||
@@ -31,7 +31,7 @@ describe('PeopleContentService', () => {
|
||||
providers: [
|
||||
PeopleContentService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
||||
import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { DownloadZipService } from './services/download-zip.service';
|
||||
import { EMPTY, Observable } from 'rxjs';
|
||||
import { EMPTY, Observable, of } from 'rxjs';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, RedirectAuthService, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -47,7 +47,7 @@ describe('DownloadZipDialogComponent', () => {
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: dataMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
]
|
||||
});
|
||||
dialogRef.close.calls.reset();
|
||||
|
@@ -22,7 +22,7 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { NodeAllowableOperationSubject } from '../interfaces/node-allowable-operation-subject.interface';
|
||||
import { ContentDirectiveModule } from './content-directive.module';
|
||||
import { RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
@Component({
|
||||
@@ -39,7 +39,7 @@ describe('CheckAllowableOperationDirective', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentDirectiveModule, HttpClientTestingModule],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }]
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
});
|
||||
changeDetectorMock = { detectChanges: () => {} } as ChangeDetectorRef;
|
||||
});
|
||||
|
@@ -41,8 +41,8 @@ describe('LibraryFavoriteDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
declarations: [TestComponent, LibraryFavoriteDirective]
|
||||
imports: [HttpClientTestingModule, TestComponent],
|
||||
declarations: [LibraryFavoriteDirective]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -23,7 +23,7 @@ import { ContentDirectiveModule } from './content-directive.module';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { RedirectAuthService, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
template: `<div id="delete-component" [adf-delete]="selection" (delete)="onDelete()"></div>`
|
||||
@@ -82,7 +82,7 @@ describe('NodeDeleteDirective', () => {
|
||||
imports: [ContentDirectiveModule, HttpClientTestingModule, TranslateModule.forRoot()],
|
||||
providers: [
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
],
|
||||
declarations: [TestComponent, TestWithPermissionsComponent, TestDeletePermanentComponent]
|
||||
});
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { NodeDownloadDirective } from './node-download.directive';
|
||||
@@ -53,7 +53,7 @@ describe('NodeDownloadDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentDirectiveModule, HttpClientTestingModule],
|
||||
imports: [ContentDirectiveModule, HttpClientTestingModule, MatDialogModule],
|
||||
declarations: [TestComponent],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
|
@@ -37,8 +37,8 @@ describe('FileAutoDownloadComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot(), MatDialogModule, MatButtonModule],
|
||||
declarations: [FileAutoDownloadComponent, NodeDownloadDirective],
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot(), MatDialogModule, MatButtonModule, NodeDownloadDirective],
|
||||
declarations: [FileAutoDownloadComponent],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: mockDialog },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: null },
|
||||
|
@@ -21,7 +21,7 @@ import { AuthenticationService, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { addDays, subDays } from 'date-fns';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
|
||||
describe('LockService', () => {
|
||||
let service: LockService;
|
||||
@@ -34,7 +34,7 @@ describe('LockService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }]
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
});
|
||||
service = TestBed.inject(LockService);
|
||||
authenticationService = TestBed.inject(AuthenticationService);
|
||||
|
@@ -20,7 +20,7 @@ import { AlfrescoApiService, AlfrescoApiServiceMock, CommentModel, RedirectAuthS
|
||||
import { fakeContentComment, fakeContentComments } from '../mocks/node-comments.mock';
|
||||
import { NodeCommentsService } from './node-comments.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -32,7 +32,7 @@ describe('NodeCommentsService', () => {
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(NodeCommentsService);
|
||||
|
@@ -308,7 +308,7 @@ describe('TagsCreatorComponent', () => {
|
||||
component.tagNameControlVisible = true;
|
||||
fixture.detectChanges();
|
||||
tick(100);
|
||||
expect(getNameInput()).not.toBe(document.activeElement as HTMLInputElement);
|
||||
expect(getNameInput()).not.toEqual(document.activeElement as HTMLInputElement);
|
||||
}));
|
||||
|
||||
it('should input be autofocused after showing input second time', fakeAsync(() => {
|
||||
|
@@ -23,7 +23,7 @@ import { VersionCompatibilityService } from './version-compatibility.service';
|
||||
import { VersionInfo } from '@alfresco/js-api';
|
||||
import { VersionCompatibilityModule } from './version-compatibility.module';
|
||||
import { RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
@Component({
|
||||
@@ -53,7 +53,7 @@ describe('VersionCompatibilityDirective', () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [VersionCompatibilityModule, HttpClientTestingModule],
|
||||
declarations: [TestComponent],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }]
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||
|
Reference in New Issue
Block a user