summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component.spec.ts
blob: b9d63853df0a3ca38ad9295eaf2d5ecb62a4ed7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { DashboardReportGridComponent } from './dashboard-report-grid.component';
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
import { HttpClientTestingModule } from '@angular/common/http/testing';

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

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], 
      declarations: [ DashboardReportGridComponent ],
      imports: [FormsModule, HttpClientTestingModule]
    })
    .compileComponents();
  })); 

  beforeEach(() => {
    fixture = TestBed.createComponent(DashboardReportGridComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });

  it('should test ngOnInit method', () => {
      component.ngOnInit();
      expect(component.showSpinner).toEqual(true);
      expect(component.options.outerMargin).toEqual(true);
      expect(component.options.outerMarginTop).toEqual(10);
      expect(component.options.outerMarginRight).toEqual(10);
      expect(component.options.outerMarginBottom).toEqual(700);
      expect(component.options.outerMarginLeft).toEqual(10);
      expect(component.options.scrollSensitivity).toEqual(10);
      expect(component.options.scrollSpeed).toEqual(20);
      expect(component.options.emptyCellDragMaxCols).toEqual(null);
      expect(component.options.emptyCellDragMaxRows).toEqual(null);
      expect(component.options.enableOccupiedCellDrop).toEqual(true);
      expect(component.options.ignoreMarginInRow).toEqual(false);
      expect(component.options.draggable.enabled).toEqual(true);
      expect(component.options.resizable.enabled).toEqual(true);
      expect(component.options.swap).toEqual(false);
      expect(component.options.pushItems).toEqual(true);
      expect(component.options.disablePushOnDrag).toEqual(false);
      expect(component.options.disablePushOnResize).toEqual(false);
      expect(component.options.pushResizeItems).toEqual(true);
      expect(component.options.disableWindowResize).toEqual(true);
      expect(component.options.disableWarnings).toEqual(false);
      expect(component.options.scrollToNewItems).toEqual(true);
      expect(component.options.enableEmptyCellDrop).toEqual(true);
      expect(component.options.minCols).toEqual(2);
      expect(component.options.minRows).toEqual(2);
  })
});