mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[affected:*][ci:force] - REBASED
This commit is contained in:
@@ -58,23 +58,19 @@ describe('AdfHttpClient', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientTestingModule
|
||||
]
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [AdfHttpClient]
|
||||
});
|
||||
angularHttpClient = TestBed.inject(AdfHttpClient);
|
||||
controller = TestBed.inject(HttpTestingController);
|
||||
});
|
||||
|
||||
|
||||
describe('deserialize', () => {
|
||||
|
||||
afterEach(() => {
|
||||
controller.verify();
|
||||
});
|
||||
|
||||
it('should deserialize incoming request based on return type', (done) => {
|
||||
|
||||
const options: RequestOptions = {
|
||||
path: '',
|
||||
httpMethod: 'POST',
|
||||
@@ -85,38 +81,41 @@ describe('AdfHttpClient', () => {
|
||||
accepts: ['application/json']
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).then((res: ResultListDataRepresentationTaskRepresentation) => {
|
||||
angularHttpClient
|
||||
.request('http://example.com', options, securityOptions, emitters)
|
||||
.then((res: ResultListDataRepresentationTaskRepresentation) => {
|
||||
expect(res instanceof ResultListDataRepresentationTaskRepresentation).toBeTruthy();
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
expect(res.data![0].created instanceof Date).toBeTruthy();
|
||||
done();
|
||||
}).catch(error=> fail(error));
|
||||
})
|
||||
.catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com');
|
||||
expect(req.request.method).toEqual('POST');
|
||||
|
||||
req.flush(mockResponse);
|
||||
|
||||
});
|
||||
|
||||
it('should return parsed json object when responseType is json', (done) => {
|
||||
|
||||
const options: RequestOptions = {
|
||||
path: '',
|
||||
httpMethod: 'POST',
|
||||
responseType: 'json'
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).then((res) => {
|
||||
angularHttpClient
|
||||
.request('http://example.com', options, securityOptions, emitters)
|
||||
.then((res) => {
|
||||
expect(res).toEqual(mockResponse);
|
||||
done();
|
||||
}).catch(error=> fail(error));
|
||||
})
|
||||
.catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com');
|
||||
expect(req.request.method).toEqual('POST');
|
||||
|
||||
req.flush(mockResponse);
|
||||
|
||||
});
|
||||
|
||||
it('should emit unauthorized message for 401 request', (done) => {
|
||||
@@ -137,11 +136,9 @@ describe('AdfHttpClient', () => {
|
||||
|
||||
req.flush('<div></div>', { status: 401, statusText: 'unauthorized' });
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('upload', () => {
|
||||
|
||||
afterEach(() => {
|
||||
controller.verify();
|
||||
});
|
||||
@@ -177,9 +174,7 @@ describe('AdfHttpClient', () => {
|
||||
returnType: null
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', requestOptions, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', requestOptions, securityOptions, emitters).catch((error) => fail(error));
|
||||
const req = controller.expectOne('http://example.com?autoRename=true&include=allowableOperations');
|
||||
expect(req.request.method).toEqual('POST');
|
||||
|
||||
@@ -251,19 +246,18 @@ describe('AdfHttpClient', () => {
|
||||
httpMethod: 'POST',
|
||||
queryParams: {
|
||||
skipCount: 0,
|
||||
status: [
|
||||
'RUNNING',
|
||||
'SUSPENDED'
|
||||
],
|
||||
status: ['RUNNING', 'SUSPENDED'],
|
||||
sort: 'startDate,DESC'
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com/candidatebaseapp/query/v1/process-instances', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient
|
||||
.request('http://example.com/candidatebaseapp/query/v1/process-instances', options, securityOptions, emitters)
|
||||
.catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com/candidatebaseapp/query/v1/process-instances?skipCount=0&status=RUNNING&status=SUSPENDED&sort=startDate%2CDESC');
|
||||
const req = controller.expectOne(
|
||||
'http://example.com/candidatebaseapp/query/v1/process-instances?skipCount=0&status=RUNNING&status=SUSPENDED&sort=startDate%2CDESC'
|
||||
);
|
||||
expect(req.request.method).toEqual('POST');
|
||||
|
||||
req.flush(null, { status: 200, statusText: 'Ok' });
|
||||
@@ -275,10 +269,13 @@ describe('AdfHttpClient', () => {
|
||||
httpMethod: 'GET'
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).then((res) => {
|
||||
angularHttpClient
|
||||
.request('http://example.com', options, securityOptions, emitters)
|
||||
.then((res) => {
|
||||
expect(res).toEqual('');
|
||||
done();
|
||||
}).catch(error=> fail(error));
|
||||
})
|
||||
.catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com');
|
||||
|
||||
@@ -294,9 +291,7 @@ describe('AdfHttpClient', () => {
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com?lastModifiedFrom=2022-08-17T00%3A00%3A00.000%2B02%3A00');
|
||||
|
||||
@@ -312,9 +307,7 @@ describe('AdfHttpClient', () => {
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com?lastModifiedFrom=2022-08-17T00%3A00%3A00.000Z');
|
||||
|
||||
@@ -331,9 +324,7 @@ describe('AdfHttpClient', () => {
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com?lastModifiedFrom=2022-08-17T00%3A00%3A00.000Z');
|
||||
|
||||
@@ -352,9 +343,7 @@ describe('AdfHttpClient', () => {
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com?lastModifiedFrom=2022-08-17T00%3A00%3A00.000Z');
|
||||
|
||||
@@ -372,9 +361,7 @@ describe('AdfHttpClient', () => {
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com?lastModifiedFrom=2022-08-17T00%3A00%3A00.000Z');
|
||||
|
||||
@@ -392,9 +379,7 @@ describe('AdfHttpClient', () => {
|
||||
}
|
||||
};
|
||||
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch(error =>
|
||||
fail(error)
|
||||
);
|
||||
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((error) => fail(error));
|
||||
|
||||
const req = controller.expectOne('http://example.com?lastModifiedFrom=2022-08-17T00%3A00%3A00.000Z');
|
||||
|
||||
@@ -402,5 +387,4 @@ describe('AdfHttpClient', () => {
|
||||
|
||||
req.flush(null, { status: 200, statusText: 'Ok' });
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { AboutGithubLinkComponent } from './about-github-link.component';
|
||||
import { aboutGithubDetails } from '../about.mock';
|
||||
|
||||
|
@@ -16,10 +16,12 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { AboutServerSettingsComponent } from './about-server-settings.component';
|
||||
import { AppConfigService } from '../../app-config/app-config.service';
|
||||
import { aboutGithubDetails } from '../about.mock';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { AppConfigServiceMock } from '../../common';
|
||||
|
||||
describe('AboutServerSettingsComponent', () => {
|
||||
let fixture: ComponentFixture<AboutServerSettingsComponent>;
|
||||
@@ -28,7 +30,8 @@ describe('AboutServerSettingsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule],
|
||||
providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }]
|
||||
});
|
||||
fixture = TestBed.createComponent(AboutServerSettingsComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -20,10 +20,13 @@ import { AppConfigService } from '../../app-config/app-config.service';
|
||||
import { AuthGuardBpm } from './auth-guard-bpm.service';
|
||||
import { AuthenticationService } from '../services/authentication.service';
|
||||
import { RouterStateSnapshot, Router } from '@angular/router';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
|
||||
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
|
||||
import { OidcAuthenticationService } from '../services/oidc-authentication.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { RedirectAuthService } from '../oidc/redirect-auth.service';
|
||||
import { EMPTY } from 'rxjs';
|
||||
|
||||
describe('AuthGuardService BPM', () => {
|
||||
let authGuard: AuthGuardBpm;
|
||||
@@ -36,8 +39,9 @@ describe('AuthGuardService BPM', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatDialogModule],
|
||||
providers: [
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } },
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
useValue: {
|
||||
|
@@ -20,10 +20,14 @@ import { AppConfigService } from '../../app-config/app-config.service';
|
||||
import { AuthGuardEcm } from './auth-guard-ecm.service';
|
||||
import { AuthenticationService } from '../services/authentication.service';
|
||||
import { RouterStateSnapshot, Router } from '@angular/router';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { OidcAuthenticationService } from '../services/oidc-authentication.service';
|
||||
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { RedirectAuthService } from '../oidc/redirect-auth.service';
|
||||
import { EMPTY } from 'rxjs';
|
||||
|
||||
describe('AuthGuardService ECM', () => {
|
||||
let authGuard: AuthGuardEcm;
|
||||
@@ -35,8 +39,10 @@ describe('AuthGuardService ECM', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, RouterTestingModule, MatDialogModule],
|
||||
providers: [
|
||||
BasicAlfrescoAuthService,
|
||||
AppConfigService,
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
useValue: {
|
||||
@@ -45,7 +51,8 @@ describe('AuthGuardService ECM', () => {
|
||||
hasValidIdToken: () => false,
|
||||
isLoggedIn: () => false
|
||||
}
|
||||
}
|
||||
},
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }
|
||||
]
|
||||
});
|
||||
localStorage.clear();
|
||||
|
@@ -17,10 +17,11 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ActivatedRouteSnapshot, Router } from '@angular/router';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { AuthGuardSsoRoleService } from './auth-guard-sso-role.service';
|
||||
import { JwtHelperService } from '../services/jwt-helper.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('Auth Guard SSO role service', () => {
|
||||
let authGuard: AuthGuardSsoRoleService;
|
||||
@@ -29,7 +30,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatDialogModule]
|
||||
});
|
||||
localStorage.clear();
|
||||
authGuard = TestBed.inject(AuthGuardSsoRoleService);
|
||||
|
@@ -20,10 +20,15 @@ import { Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { AppConfigService } from '../../app-config/app-config.service';
|
||||
import { AuthGuard } from './auth-guard.service';
|
||||
import { AuthenticationService } from '../services/authentication.service';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { StorageService } from '../../common/services/storage.service';
|
||||
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
|
||||
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
|
||||
import { RedirectAuthService } from '../oidc/redirect-auth.service';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
describe('AuthGuardService', () => {
|
||||
let state;
|
||||
@@ -37,8 +42,11 @@ describe('AuthGuardService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatDialogModule, RouterTestingModule],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
StorageService,
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } },
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
useValue: {
|
||||
|
@@ -27,8 +27,9 @@ import {
|
||||
mockIdentityGroups,
|
||||
roleMappingMock
|
||||
} from '../mock/identity-group.mock';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AdfHttpClient } from '../../../../api/src';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('IdentityGroupService', () => {
|
||||
let service: IdentityGroupService;
|
||||
@@ -37,7 +38,8 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule],
|
||||
providers: [AdfHttpClient]
|
||||
});
|
||||
service = TestBed.inject(IdentityGroupService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
|
@@ -32,9 +32,10 @@ import { IdentityUserService } from './identity-user.service';
|
||||
import { JwtHelperService } from './jwt-helper.service';
|
||||
import { mockToken } from '../mock/jwt-helper.service.spec';
|
||||
import { IdentityRoleModel } from '../models/identity-role.model';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AdfHttpClient } from '../../../../api/src';
|
||||
import { StorageService } from '../../common/services/storage.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('IdentityUserService', () => {
|
||||
const mockRoles = [
|
||||
@@ -52,7 +53,8 @@ describe('IdentityUserService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule],
|
||||
providers: [StorageService, AdfHttpClient]
|
||||
});
|
||||
storageService = TestBed.inject(StorageService);
|
||||
service = TestBed.inject(IdentityUserService);
|
||||
|
@@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CoreTestingModule } from '../../testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { UserAccessService } from './user-access.service';
|
||||
import { JwtHelperService } from './jwt-helper.service';
|
||||
import { AppConfigService } from '../../app-config';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('UserAccessService', () => {
|
||||
let userAccessService: UserAccessService;
|
||||
@@ -28,7 +28,7 @@ describe('UserAccessService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [UserAccessService]
|
||||
});
|
||||
userAccessService = TestBed.inject(UserAccessService);
|
||||
@@ -83,7 +83,6 @@ describe('UserAccessService', () => {
|
||||
});
|
||||
|
||||
describe('Access present in realm_access', () => {
|
||||
|
||||
it('should return true when the user has one of the global roles', () => {
|
||||
spyRealmAccess(['MOCK_USER_ROLE', 'MOCK_USER_ROLE_2'], {});
|
||||
userAccessService.fetchUserAccess();
|
||||
@@ -118,7 +117,6 @@ describe('UserAccessService', () => {
|
||||
});
|
||||
|
||||
describe('Access present in hxp_authorization', () => {
|
||||
|
||||
it('should return true when the user has one of the global roles', () => {
|
||||
spyHxpAuthorization('mockApp1', ['MOCK_GLOBAL_USER_ROLE']);
|
||||
appConfigService.config = { application: { key: 'mockApp1' } };
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
@@ -50,7 +49,7 @@ describe('ButtonsMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MaterialModule],
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [CustomContainerComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
@@ -93,7 +92,7 @@ describe('ButtonsMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MaterialModule],
|
||||
imports: [TranslateModule.forRoot(), MaterialModule],
|
||||
declarations: [CustomEmptyContainerComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
@@ -21,7 +21,7 @@ import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { CardViewBoolItemComponent } from './card-view-boolitem.component';
|
||||
import { CardViewBoolItemModel } from '../../models/card-view-boolitem.model';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('CardViewBoolItemComponent', () => {
|
||||
let fixture: ComponentFixture<CardViewBoolItemComponent>;
|
||||
@@ -29,7 +29,7 @@ describe('CardViewBoolItemComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [TranslateModule.forRoot()]
|
||||
});
|
||||
fixture = TestBed.createComponent(CardViewBoolItemComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -20,7 +20,6 @@ import { By } from '@angular/platform-browser';
|
||||
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { CardViewDateItemComponent } from './card-view-dateitem.component';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
||||
import { CardViewDatetimeItemModel } from '../../models/card-view-datetimeitem.model';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -29,6 +28,14 @@ import { MatDatetimepickerInputEvent } from '@mat-datetimepicker/core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { TranslationMock } from '../../../mock';
|
||||
import { TranslationService } from '../../../translation';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
|
||||
describe('CardViewDateItemComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -38,7 +45,16 @@ describe('CardViewDateItemComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), CoreTestingModule]
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
NoopAnimationsModule,
|
||||
HttpClientTestingModule,
|
||||
MatSnackBarModule,
|
||||
MatDatepickerModule,
|
||||
MatDialogModule,
|
||||
MatTooltipModule
|
||||
],
|
||||
providers: [ClipboardService, { provide: TranslationService, useClass: TranslationMock }]
|
||||
});
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
appConfigService.config.dateValues = {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IdentityGroupService } from './identity-group.service';
|
||||
import {
|
||||
mockHttpErrorResponse,
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
} from '../mock/identity-group.service.mock';
|
||||
import { mockFoodGroups } from '../mock/group-cloud.mock';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('IdentityGroupService', () => {
|
||||
let service: IdentityGroupService;
|
||||
@@ -34,7 +35,8 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule],
|
||||
providers: [IdentityGroupService]
|
||||
});
|
||||
service = TestBed.inject(IdentityGroupService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
|
Reference in New Issue
Block a user