1 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 import { FormsModule } from '@angular/forms';
3 import { DashboardReportGridComponent } from './dashboard-report-grid.component';
4 import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
5 import { HttpClientTestingModule } from '@angular/common/http/testing';
7 describe('DashboardReportGridComponent', () => {
8 let component: DashboardReportGridComponent;
9 let fixture: ComponentFixture<DashboardReportGridComponent>;
11 beforeEach(async(() => {
12 TestBed.configureTestingModule({
13 schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
14 declarations: [ DashboardReportGridComponent ],
15 imports: [FormsModule, HttpClientTestingModule]
21 fixture = TestBed.createComponent(DashboardReportGridComponent);
22 component = fixture.componentInstance;
23 fixture.detectChanges();
26 it('should create', () => {
27 expect(component).toBeTruthy();
30 it('should test ngOnInit method', () => {
32 expect(component.showSpinner).toEqual(true);
33 expect(component.options.outerMargin).toEqual(true);
34 expect(component.options.outerMarginTop).toEqual(10);
35 expect(component.options.outerMarginRight).toEqual(10);
36 expect(component.options.outerMarginBottom).toEqual(700);
37 expect(component.options.outerMarginLeft).toEqual(10);
38 expect(component.options.scrollSensitivity).toEqual(10);
39 expect(component.options.scrollSpeed).toEqual(20);
40 expect(component.options.emptyCellDragMaxCols).toEqual(null);
41 expect(component.options.emptyCellDragMaxRows).toEqual(null);
42 expect(component.options.enableOccupiedCellDrop).toEqual(true);
43 expect(component.options.ignoreMarginInRow).toEqual(false);
44 expect(component.options.draggable.enabled).toEqual(true);
45 expect(component.options.resizable.enabled).toEqual(true);
46 expect(component.options.swap).toEqual(false);
47 expect(component.options.pushItems).toEqual(true);
48 expect(component.options.disablePushOnDrag).toEqual(false);
49 expect(component.options.disablePushOnResize).toEqual(false);
50 expect(component.options.pushResizeItems).toEqual(true);
51 expect(component.options.disableWindowResize).toEqual(true);
52 expect(component.options.disableWarnings).toEqual(false);
53 expect(component.options.scrollToNewItems).toEqual(true);
54 expect(component.options.enableEmptyCellDrop).toEqual(true);
55 expect(component.options.minCols).toEqual(2);
56 expect(component.options.minRows).toEqual(2);