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

27 lines
790 B
JavaScript

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', () => {
controller.showReport = jest.fn();
const params = {
clientId: controller.vnConfig.storage.currentUserWorkerId,
entryId: entry.id
};
controller.showEntryReport();
expect(controller.showReport).toHaveBeenCalledWith('entry-order', params);
});
});
});