From c33a846edd620f255920a9d76deec3100bb9ef39 Mon Sep 17 00:00:00 2001 From: Mario Romano Date: Thu, 22 Sep 2016 10:33:01 +0100 Subject: [PATCH] add first test --- .../ng2-activiti-analytics/karma-test-shim.js | 1 + .../components/analytics.component.spec.ts | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts diff --git a/ng2-components/ng2-activiti-analytics/karma-test-shim.js b/ng2-components/ng2-activiti-analytics/karma-test-shim.js index c5e3b8a8c6..5a6d23240a 100644 --- a/ng2-components/ng2-activiti-analytics/karma-test-shim.js +++ b/ng2-components/ng2-activiti-analytics/karma-test-shim.js @@ -18,6 +18,7 @@ var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' }, 'ng2-translate': { defaultExtension: 'js' }, + 'ng2-charts': { defaultExtension: 'js' }, 'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' } }; diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts new file mode 100644 index 0000000000..e79859d36d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 { describe, expect, it, inject } from '@angular/core/testing'; +import { TestComponentBuilder } from '@angular/compiler/testing'; +import { AnalyticsComponent } from './analytics.component'; + +describe('Show component HTML', () => { + it('Display component tag base-chart', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { + return tcb + .createAsync(AnalyticsComponent) + .then((fixture) => { + let element = fixture.nativeElement; + expect(element.getElementsByTagName('base-chart')[0].innerHTML).toBeDefined(); + }); + })); +});