mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4911] migrate identity role service (#5096)
* migrate IdentityRoleService implementation * update unit tests * move interfaces to the origin * move models to proper places * migrate model to interface * fix test * update docs
This commit is contained in:
committed by
Eugenio Romano
parent
3fc9390666
commit
f731988ca6
@@ -21,16 +21,15 @@ import { AuthenticationService, ContentService } from '../../services';
|
||||
import { InitialUsernamePipe } from '../../pipes';
|
||||
import { fakeBpmUser } from '../../mock/bpm-user.service.mock';
|
||||
import { fakeEcmEditedUser, fakeEcmUser, fakeEcmUserNoImage } from '../../mock/ecm-user.service.mock';
|
||||
import { BpmUserService } from '../services/bpm-user.service';
|
||||
import { EcmUserService } from '../services/ecm-user.service';
|
||||
import { IdentityUserService } from '../services/identity-user.service';
|
||||
import { BpmUserModel } from './../models/bpm-user.model';
|
||||
import { EcmUserModel } from './../models/ecm-user.model';
|
||||
import { BpmUserService } from '../../services/bpm-user.service';
|
||||
import { EcmUserService } from '../../services/ecm-user.service';
|
||||
import { IdentityUserService } from '../../services/identity-user.service';
|
||||
import { BpmUserModel } from '../../models/bpm-user.model';
|
||||
import { EcmUserModel } from '../../models/ecm-user.model';
|
||||
import { UserInfoComponent } from './user-info.component';
|
||||
import { of } from 'rxjs';
|
||||
import { setupTestBed } from '../../testing/setupTestBed';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { IdentityUserModel } from '../models/identity-user.model';
|
||||
|
||||
class FakeSanitizer extends DomSanitizer {
|
||||
|
||||
@@ -556,7 +555,7 @@ describe('User info component', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
component.identityUser$.subscribe((response: IdentityUserModel) => {
|
||||
component.identityUser$.subscribe(response => {
|
||||
expect(response).toBeDefined();
|
||||
expect(response.firstName).toBe('fake-identity-first-name');
|
||||
expect(response.lastName).toBe('fake-identity-last-name');
|
||||
@@ -583,8 +582,7 @@ describe('User info component', () => {
|
||||
|
||||
it('should show last name if first name is null', async(() => {
|
||||
fixture.detectChanges();
|
||||
const fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutFirstNameMock);
|
||||
getCurrentUserInfoStub.and.returnValue(fakeIdentityUser);
|
||||
getCurrentUserInfoStub.and.returnValue(identityUserWithOutFirstNameMock);
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
@@ -598,8 +596,7 @@ describe('User info component', () => {
|
||||
}));
|
||||
|
||||
it('should not show first name if it is null string', async(() => {
|
||||
const fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutFirstNameMock);
|
||||
getCurrentUserInfoStub.and.returnValue(of(fakeIdentityUser));
|
||||
getCurrentUserInfoStub.and.returnValue(of(identityUserWithOutFirstNameMock));
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
@@ -613,8 +610,7 @@ describe('User info component', () => {
|
||||
}));
|
||||
|
||||
it('should not show last name if it is null string', async(() => {
|
||||
const fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutLastNameMock);
|
||||
getCurrentUserInfoStub.and.returnValue(of(fakeIdentityUser));
|
||||
getCurrentUserInfoStub.and.returnValue(of(identityUserWithOutLastNameMock));
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
|
@@ -17,12 +17,12 @@
|
||||
|
||||
import { Component, Input, OnInit, ViewEncapsulation, ViewChild } from '@angular/core';
|
||||
import { AuthenticationService } from '../../services/authentication.service';
|
||||
import { BpmUserModel } from './../models/bpm-user.model';
|
||||
import { EcmUserModel } from './../models/ecm-user.model';
|
||||
import { IdentityUserModel } from './../models/identity-user.model';
|
||||
import { BpmUserService } from './../services/bpm-user.service';
|
||||
import { EcmUserService } from './../services/ecm-user.service';
|
||||
import { IdentityUserService } from '../services/identity-user.service';
|
||||
import { BpmUserModel } from '../../models/bpm-user.model';
|
||||
import { EcmUserModel } from '../../models/ecm-user.model';
|
||||
import { IdentityUserModel } from '../../models/identity-user.model';
|
||||
import { BpmUserService } from '../../services/bpm-user.service';
|
||||
import { EcmUserService } from '../../services/ecm-user.service';
|
||||
import { IdentityUserService } from '../../services/identity-user.service';
|
||||
import { of, Observable } from 'rxjs';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
|
||||
|
Reference in New Issue
Block a user