How to use the @alfresco/adf-core.AlfrescoApiServiceMock function in @alfresco/adf-core

To help you get started, we’ve selected a few @alfresco/adf-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / alfresco-ng2-components / lib / content-services / src / lib / document-list / services / document-actions.service.spec.ts View on Github external
describe('DocumentActionsService', () => {

    let service: DocumentActionsService;
    let documentListService: DocumentListService;

    setupTestBed({
        imports: [CoreModule.forRoot()],
        providers: [
            {
                provide: AlfrescoApiService,
                useValue: new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService())
            }
        ]
    });

    beforeEach(() => {
        const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
        const contentService = TestBed.get(ContentService);

        documentListService = new DocumentListService(contentService, alfrescoApiService, null, null);
        service = new DocumentActionsService(null, null, new TranslationMock(), documentListService, contentService);
    });

    it('should register default download action', () => {
        expect(service.getHandler('download')).not.toBeNull();
    });
github Alfresco / alfresco-content-app / src / app / directives / library-membership.directive.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [AppTestingModule, DirectivesModule, CoreModule.forRoot()],
      schemas: [NO_ERRORS_SCHEMA]
    });
    alfrescoApiService = new AlfrescoApiServiceMock(
      new AppConfigService(null),
      new StorageService()
    );
    peopleApi = alfrescoApiService.getInstance().core.peopleApi;
    directive = new LibraryMembershipDirective(alfrescoApiService);
  });