Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
});
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
BrowserAnimationsModule,
RouterTestingModule,
CoreModule.forRoot(),
ContentModule.forRoot(),
ProcessServicesCloudModule
],
declarations: [TasksComponent],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
]
})
.compileComponents();
}));
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { CoreModule, AppConfigService, DebugAppConfigService, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
@NgModule({
imports: [ CoreModule.forRoot() ],
exports: [ CoreModule ],
providers: [
{ provide: AppConfigService, useClass: DebugAppConfigService },
{ provide: TRANSLATION_PROVIDER, multi: true, useValue: { name: 'app', source: 'resources' } }
]
})
export class AdfModule {}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
BrowserAnimationsModule,
CoreModule.forRoot(),
ContentModule.forRoot(),
ProcessServicesCloudModule,
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
})
],
declarations: [TasksComponent],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: AppConfigService, useClass: AppConfigServiceMock }
]
});
fixture = TestBed.createComponent(TasksComponent);
alfrescoApiService = TestBed.get(AlfrescoApiService);
component = fixture.componentInstance;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
BrowserAnimationsModule,
CoreModule.forRoot(),
ContentModule.forRoot(),
ProcessServicesCloudModule
],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
],
declarations: [ LoginComponent ]
})
.compileComponents();
}));
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
CoreModule.forRoot(),
ContentModule.forRoot(),
ProcessModule.forRoot(),
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
})
],
declarations: [DocumentlistComponent],
providers: [
PreviewService,
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: AppConfigService, useClass: AppConfigServiceMock },
{ provide: Location, useClass: SpyLocation }
]
});
fixture = TestBed.createComponent(DocumentlistComponent);
describe('LibraryDialogComponent', () => {
let fixture;
let component;
let alfrescoApi;
let findSitesSpy;
const findSitesResponse = { list: { entries: [] } };
const dialogRef = {
close: jasmine.createSpy('close')
};
setupTestBed({
imports: [NoopAnimationsModule, CoreModule.forRoot(), ReactiveFormsModule],
declarations: [LibraryDialogComponent],
providers: [
{
provide: AlfrescoApiService,
useClass: AlfrescoApiServiceMock
},
{ provide: MatDialogRef, useValue: dialogRef }
],
schemas: [NO_ERRORS_SCHEMA]
});
beforeEach(() => {
fixture = TestBed.createComponent(LibraryDialogComponent);
component = fixture.componentInstance;
alfrescoApi = TestBed.get(AlfrescoApiService);
findSitesSpy = spyOn(alfrescoApi.getInstance().core.queriesApi, 'findSites');
registerLocaleData(localeFi);
registerLocaleData(localeDa);
registerLocaleData(localeSv);
@NgModule({
imports: [
BrowserModule,
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
ReactiveFormsModule,
routing,
FormsModule,
HttpClientModule,
MaterialModule,
AppExtensionsModule,
FlexLayoutModule,
CoreModule.forRoot(),
ContentModule.forRoot(),
InsightsModule.forRoot(),
ProcessModule.forRoot(),
ProcessServicesCloudModule,
ExtensionsModule.forRoot(),
ThemePickerModule,
ChartsModule,
AppCloudSharedModule,
MonacoEditorModule.forRoot()
],
declarations: [
AppComponent,
LogoutComponent,
AppLayoutComponent,
HomeComponent,
SearchBarComponent,
describe('Inject [UserPreferenceCloudService] into the ProcessFilterCloudService', () => {
let service: ProcessFilterCloudService;
let preferenceCloudService: PreferenceCloudServiceInterface;
let identityUserService: IdentityUserService;
const identityUserMock = { username: 'mock-username', firstName: 'fake-identity-first-name', lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' };
setupTestBed({
imports: [
CoreModule.forRoot()
],
providers: [
ProcessFilterCloudService,
IdentityUserService,
UserPreferenceCloudService,
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService }
]
});
beforeEach(async(() => {
service = TestBed.get(ProcessFilterCloudService);
preferenceCloudService = service.preferenceService;
identityUserService = TestBed.get(IdentityUserService);
spyOn(identityUserService, 'getCurrentUserInfo').and.returnValue(identityUserMock);
}));
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
BrowserAnimationsModule,
CoreModule.forRoot(),
ContentModule.forRoot(),
ProcessServicesCloudModule,
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
})
],
declarations: [TasksComponent],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: AppConfigService, useClass: AppConfigServiceMock }
]
});
fixture = TestBed.createComponent(TasksComponent);
alfrescoApiService = TestBed.get(AlfrescoApiService);
component = fixture.componentInstance;