Some changes
gitea/salix/2138-zone_event_m3 There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-02-26 12:24:48 +01:00
parent e09325b3fa
commit ce84d26fae
1 changed files with 9 additions and 9 deletions

View File

@ -49,32 +49,32 @@ describe('Zone Component vnZoneDeliveryDays', () => {
}); });
describe('onSelection()', () => { describe('onSelection()', () => {
it('should not call the show popover method', () => { it('should not call the show popover method if events array is empty', () => {
jest.spyOn(controller.$.zoneEvents, 'show'); jest.spyOn(controller.$.zoneEvents, 'show');
const $event = new Event('click'); const event = new Event('click');
const target = document.createElement('div'); const target = document.createElement('div');
target.dispatchEvent($event); target.dispatchEvent(event);
const $events = []; const events = [];
controller.onSelection($event, $events); controller.onSelection(event, events);
expect(controller.$.zoneEvents.show).not.toHaveBeenCalled(); expect(controller.$.zoneEvents.show).not.toHaveBeenCalled();
}); });
it('should call the show() method and then call the applyFilter() method with the spected ids', () => { it('should call the show() method and then call the applyFilter() method with the expected ids', () => {
const zoneModel = controller.$.zoneIndex.$scope.model; const zoneModel = controller.$.zoneIndex.$scope.model;
jest.spyOn(controller.$.zoneEvents, 'show'); jest.spyOn(controller.$.zoneEvents, 'show');
jest.spyOn(zoneModel, 'applyFilter'); jest.spyOn(zoneModel, 'applyFilter');
const $event = new Event('click'); const event = new Event('click');
const target = document.createElement('div'); const target = document.createElement('div');
target.dispatchEvent($event); target.dispatchEvent($event);
const $events = [ const events = [
{zoneFk: 1}, {zoneFk: 1},
{zoneFk: 2}, {zoneFk: 2},
{zoneFk: 8} {zoneFk: 8}
]; ];
controller.onSelection($event, $events); controller.onSelection(event, events);
const expectedFilter = { const expectedFilter = {
include: { include: {
relation: 'agencyMode', relation: 'agencyMode',