// import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; // import { TableModalComponent } from './table.modal'; // import { BsModalRef } from 'ngx-bootstrap/modal'; // import { AgGridModule } from 'ag-grid-angular'; // // import { ModalService } from '../../../../../../../esp-dpo/src/'; // import { VOLATILITY_MODAL_DATA } from '../../../../mockup'; // import { ModalModule } from 'ngx-bootstrap/modal'; // import { BrowserModule } from '@angular/platform-browser'; // // import { ApolloModule } from 'apollo-angular'; // import { AGGRID_LICENSE_KEY } from '../../../../utils/global.const'; // import { LicenseManager } from 'ag-grid-enterprise'; // import { RouterTestingModule } from '@angular/router/testing'; // LicenseManager.setLicenseKey(AGGRID_LICENSE_KEY); // describe('TableModal', () => { // let component: TableModalComponent; // let fixture: ComponentFixture; // let bsRef: BsModalRef; // beforeAll(() => { // // Below is the hack to bypass the AG Grid non licensed test cases. // // Needs to be removed once we have the license. // window.location.hostname = 'www.aggrid.com'; // window.location.search = 'forceWatermark'; // }); // beforeEach(waitForAsync(() => { // TestBed.configureTestingModule({ // declarations: [TableModalComponent], // providers: [BsModalRef], // imports: [AgGridModule.withComponents([]), ModalModule.forRoot(), RouterTestingModule.withRoutes([])], // }) // .overrideModule(BrowserModule, { set: { entryComponents: [TableModalComponent] } }) // .compileComponents(); // })); // beforeEach(() => { // fixture = TestBed.createComponent(TableModalComponent); // bsRef = TestBed.inject(BsModalRef); // component = fixture.componentInstance; // component.data = VOLATILITY_MODAL_DATA.data; // component.bsModalRef = new BsModalRef(); // component.bsModalRef.hide = jest.fn(); // component.gridApi = {}; // component.gridColumnApi = {}; // fixture.detectChanges(); // }); // it('should create', () => { // expect(component).toBeTruthy(); // }); // it('should fire grid API', () => { // expect(component.gridApi).toBeTruthy(); // }); // it('should load grid', () => { // const setDomLayout = jest.fn(); // const successCallback = jest.fn(); // const params = { // gridApi: component.gridApi, // gridColumnApi: component.gridColumnApi, // api: { // setDomLayout, // }, // successCallback, // data: { period_weekly: '10-10-2020' }, // }; // component.onGridReady(params); // expect(component.gridApi).toBeTruthy(); // }); // it('should fire bsRef hide method onClose', () => { // component.onClose(); // expect(component.bsModalRef.hide).toHaveBeenCalled(); // }); // });