1 import { IdlService } from '@eg/core/idl.service';
2 import { GridComponent } from './grid.component';
3 import { OrgService } from '@eg/core/org.service';
4 import { ServerStoreService } from '@eg/core/server-store.service';
5 import { FormatService } from '@eg/core/format.service';
6 import { GridDataSource } from './grid';
8 const mockIdl = jasmine.createSpyObj<IdlService>([], {classes: {}});
9 const mockOrg = jasmine.createSpyObj<OrgService>(['root']);
10 const mockStore = jasmine.createSpyObj<ServerStoreService>(['getItem', 'setItem']);
11 const mockFormat = jasmine.createSpyObj<FormatService>(['transform']);
12 let component: GridComponent;
14 describe('GridComponent', () => {
16 component = new GridComponent(mockIdl, mockOrg, mockStore, mockFormat);
18 describe('ngOnInit', () => {
19 it('adds initialFilterValues to the context', () => {
20 component.initialFilterValues = {deleted: 'f'};
21 component.dataSource = new GridDataSource();
23 expect(component.context.initialFilterValues).toEqual({deleted: 'f'});