Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
santam85 committed Feb 14, 2024
1 parent f752a50 commit 3d2d1d7
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 12 deletions.
8 changes: 7 additions & 1 deletion apps/ng2-charts-demo/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import { TestBed, waitForAsync } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { provideMarkdown } from 'ngx-markdown';
import { RouterTestingModule } from '@angular/router/testing';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';

import DataLabelsPlugin from 'chartjs-plugin-datalabels';

describe('AppComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [AppComponent, RouterTestingModule],
providers: [provideMarkdown()],
providers: [
provideMarkdown(),
provideCharts(withDefaultRegisterables(DataLabelsPlugin)),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BarChartComponent } from './bar-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('BarChartComponent', () => {
let component: BarChartComponent;
let fixture: ComponentFixture<BarChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BubbleChartComponent } from './bubble-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('BubbleChartComponent', () => {
let component: BubbleChartComponent;
let fixture: ComponentFixture<BubbleChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DoughnutChartComponent } from './doughnut-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('DoughnutChartComponent', () => {
let component: DoughnutChartComponent;
let fixture: ComponentFixture<DoughnutChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DynamicChartComponent } from './dynamic-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('DynamicChartComponent', () => {
let component: DynamicChartComponent;
let fixture: ComponentFixture<DynamicChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
OhlcController,
OhlcElement,
} from 'chartjs-chart-financial';
import { provideNoopAnimations } from '@angular/platform-browser/animations';

describe('FinancialChartComponent', () => {
let component: FinancialChartComponent;
Expand All @@ -18,6 +19,7 @@ describe('FinancialChartComponent', () => {
return TestBed.configureTestingModule({
imports: [FinancialChartComponent],
providers: [
provideNoopAnimations(),
provideCharts(withDefaultRegisterables(), {
registerables: [
CandlestickController,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { LandingComponent } from './landing.component';
import { MarkdownComponent } from 'ngx-markdown';
import { provideMarkdown } from 'ngx-markdown';

describe('LandingComponent', () => {
let component: LandingComponent;
let fixture: ComponentFixture<LandingComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [LandingComponent, MarkdownComponent],
imports: [LandingComponent],
providers: [provideMarkdown()],
}).compileComponents();

fixture = TestBed.createComponent(LandingComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { LineChartComponent } from './line-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('LineChartComponent', () => {
let component: LineChartComponent;
let fixture: ComponentFixture<LineChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { PieChartComponent } from './pie-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('PieChartComponent', () => {
let component: PieChartComponent;
let fixture: ComponentFixture<PieChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { PolarAreaChartComponent } from './polar-area-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideHighlightjs } from '../app.config';
import { provideNoopAnimations } from '@angular/platform-browser/animations';

describe('PolarAreaChartComponent', () => {
let component: PolarAreaChartComponent;
let fixture: ComponentFixture<PolarAreaChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideNoopAnimations(),
provideHighlightjs(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { RadarChartComponent } from './radar-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideHighlightjs } from '../app.config';

describe('RadarChartComponent', () => {
let component: RadarChartComponent;
let fixture: ComponentFixture<RadarChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ScatterChartComponent } from './scatter-chart.component';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { provideHighlightjs } from '../app.config';
import { provideNoopAnimations } from '@angular/platform-browser/animations';

describe('ScatterChartComponent', () => {
let component: ScatterChartComponent;
let fixture: ComponentFixture<ScatterChartComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideCharts(withDefaultRegisterables())],
providers: [
provideHighlightjs(),
provideNoopAnimations(),
provideCharts(withDefaultRegisterables()),
],
}).compileComponents();
}));

Expand Down

0 comments on commit 3d2d1d7

Please sign in to comment.