231801_test_to_master #1519
|
@ -17,17 +17,6 @@ describe('Component vnTh', () => {
|
|||
controller.column.setAttribute('field', 'MyField');
|
||||
}));
|
||||
|
||||
describe('onInit()', () => {
|
||||
it(`should define controllers order as per defaultOrder then call setOrder()`, () => {
|
||||
controller.defaultOrder = 'DESC';
|
||||
jest.spyOn(controller.table, 'setOrder');
|
||||
controller.$onInit();
|
||||
|
||||
expect(controller.order).toEqual('DESC');
|
||||
expect(controller.table.setOrder).toHaveBeenCalledWith('MyField', 'DESC');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toggleOrder()', () => {
|
||||
it(`should change the ordenation to DESC (descendant) if it was ASC (ascendant)`, () => {
|
||||
controller.order = 'ASC';
|
||||
|
@ -61,7 +50,7 @@ describe('Component vnTh', () => {
|
|||
expect(controller.updateArrow).not.toHaveBeenCalledWith();
|
||||
});
|
||||
|
||||
it(`should call toggleOrder() method if field property and
|
||||
it(`should call toggleOrder() method if field property and
|
||||
table field property equals and then call updateArrow()`, () => {
|
||||
controller.table.field = 'MyField';
|
||||
jest.spyOn(controller, 'toggleOrder');
|
||||
|
@ -73,7 +62,7 @@ describe('Component vnTh', () => {
|
|||
expect(controller.updateArrow).toHaveBeenCalledWith();
|
||||
});
|
||||
|
||||
it(`should call setOrder() method if field property and
|
||||
it(`should call setOrder() method if field property and
|
||||
table field property doesn't equals and then call updateArrow()`, () => {
|
||||
controller.table.field = 'MyField2';
|
||||
jest.spyOn(controller.table, 'setOrder');
|
||||
|
|
Loading…
Reference in New Issue