mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
fix rebase
This commit is contained in:
@@ -15,8 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { fakeEcmUserList, createNewPersonMock, fakeEcmUser, fakeEcmUser2, fakeEcmAdminUser, fakeEcmUserList } from '../mocks/ecm-user.service.mock';
|
import { fakeEcmUserList, createNewPersonMock, fakeEcmUser, fakeEcmUser2, fakeEcmAdminUser } from '../mocks/ecm-user.service.mock';
|
||||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AuthenticationService, CoreTestingModule, LogService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, AlfrescoApiServiceMock, CoreTestingModule, LogService } from '@alfresco/adf-core';
|
||||||
import { PeopleContentQueryRequestModel, PeopleContentService } from './people-content.service';
|
import { PeopleContentQueryRequestModel, PeopleContentService } from './people-content.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
@@ -123,19 +123,6 @@ describe('PeopleContentService', () => {
|
|||||||
expect(getCurrentPersonSpy.calls.count()).toEqual(1);
|
expect(getCurrentPersonSpy.calls.count()).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reset the admin cache upon logout', async (done) => {
|
|
||||||
spyOn(peopleContentService.peopleApi, 'getPerson').and.returnValue(Promise.resolve({ entry: fakeEcmAdminUser } as any));
|
|
||||||
|
|
||||||
const user = await peopleContentService.getCurrentUserInfo().toPromise();
|
|
||||||
expect(user.id).toEqual('fake-id');
|
|
||||||
expect(peopleContentService.isCurrentUserAdmin()).toBe(true);
|
|
||||||
|
|
||||||
authenticationService.onLogout.subscribe(()=>{
|
|
||||||
expect(peopleContentService.isCurrentUserAdmin()).toBe(false);
|
|
||||||
done()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not change current user on every getPerson call', async () => {
|
it('should not change current user on every getPerson call', async () => {
|
||||||
const getCurrentPersonSpy = spyOn(peopleContentService.peopleApi, 'getPerson').and.returnValue(Promise.resolve({entry: fakeEcmAdminUser} as any));
|
const getCurrentPersonSpy = spyOn(peopleContentService.peopleApi, 'getPerson').and.returnValue(Promise.resolve({entry: fakeEcmAdminUser} as any));
|
||||||
await peopleContentService.getCurrentUserInfo().toPromise();
|
await peopleContentService.getCurrentUserInfo().toPromise();
|
||||||
|
|||||||
Reference in New Issue
Block a user