Skip to content

Commit

Permalink
feat(tests): add more RowDetailExtension tests (#185)
Browse files Browse the repository at this point in the history
* feat(tests): add more Extensions unit tests

* refactor(tests): cleanup some test code

* feat(tests): add more RowDetailExtension unit tests
  • Loading branch information
ghiscoding committed Jun 8, 2019
1 parent 5f6f3b0 commit e4d99e9
Show file tree
Hide file tree
Showing 6 changed files with 501 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const mockAddon = jest.fn().mockImplementation(() => ({
getColumnDefinition: jest.fn(),
selectRows: jest.fn(),
}));

const mockSelectionModel = jest.fn().mockImplementation(() => ({
init: jest.fn(),
destroy: jest.fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ describe('draggableGroupingExtension', () => {
extension = new DraggableGroupingExtension(extensionUtility, sharedService);
});

it('should return null when either the grid object or the grid options is missing', () => {
it('should return null after calling "create" method when the grid options is missing', () => {
const output = extension.create(null);
expect(output).toBeNull();
});

it('should return null after calling "register" method when either the grid object or the grid options is missing', () => {
const output = extension.register();
expect(output).toBeNull();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import { HeaderMenuExtension } from '../headerMenuExtension';
import { ExtensionUtility } from '../extensionUtility';
import { SharedService } from '../../services/shared.service';
import { Column, ColumnSort } from '../../models';
import { ExportService, FilterService, SortService } from '../../services';
import { FilterService, SortService } from '../../services';

declare var Slick: any;
jest.mock('flatpickr', () => { });

const exportServiceStub = {
exportToFile: jest.fn(),
} as unknown as ExportService;

const filterServiceStub = {
clearFilterByColumnId: jest.fn(),
} as unknown as FilterService;
Expand Down
Loading

0 comments on commit e4d99e9

Please sign in to comment.