salix/modules/entry/front/descriptor/index.spec.js

28 lines
852 B
JavaScript
Raw Normal View History

import './index.js';
describe('Entry Component vnEntryDescriptor', () => {
let controller;
const entry = {id: 2};
beforeEach(ngModule('entry'));
beforeEach(inject($componentController => {
controller = $componentController('vnEntryDescriptor', {$element: null}, {entry});
}));
describe('showEntryReport()', () => {
it('should open a new window showing a delivery note PDF document', () => {
2020-06-12 12:28:29 +00:00
jest.spyOn(controller.vnReport, 'show');
2020-06-12 12:28:29 +00:00
window.open = jasmine.createSpy('open');
const params = {
clientId: controller.vnConfig.storage.currentUserWorkerId,
entryId: entry.id
};
controller.showEntryReport();
2020-06-12 12:28:29 +00:00
expect(controller.vnReport.show).toHaveBeenCalledWith('entry-order', params);
});
});
});