Some changes
gitea/salix/2138-zone_event_m3 There was a failure building this commit
Details
gitea/salix/2138-zone_event_m3 There was a failure building this commit
Details
This commit is contained in:
parent
e09325b3fa
commit
ce84d26fae
|
@ -49,32 +49,32 @@ describe('Zone Component vnZoneDeliveryDays', () => {
|
|||
});
|
||||
|
||||
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');
|
||||
|
||||
const $event = new Event('click');
|
||||
const event = new Event('click');
|
||||
const target = document.createElement('div');
|
||||
target.dispatchEvent($event);
|
||||
const $events = [];
|
||||
controller.onSelection($event, $events);
|
||||
target.dispatchEvent(event);
|
||||
const events = [];
|
||||
controller.onSelection(event, events);
|
||||
|
||||
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;
|
||||
jest.spyOn(controller.$.zoneEvents, 'show');
|
||||
jest.spyOn(zoneModel, 'applyFilter');
|
||||
|
||||
const $event = new Event('click');
|
||||
const event = new Event('click');
|
||||
const target = document.createElement('div');
|
||||
target.dispatchEvent($event);
|
||||
const $events = [
|
||||
const events = [
|
||||
{zoneFk: 1},
|
||||
{zoneFk: 2},
|
||||
{zoneFk: 8}
|
||||
];
|
||||
controller.onSelection($event, $events);
|
||||
controller.onSelection(event, events);
|
||||
const expectedFilter = {
|
||||
include: {
|
||||
relation: 'agencyMode',
|
||||
|
|
Loading…
Reference in New Issue