2020-02-24 11:20:53 +00:00
|
|
|
import './index.js';
|
|
|
|
|
|
|
|
describe('Entry Component vnEntryDescriptor', () => {
|
|
|
|
let controller;
|
2020-04-30 10:48:52 +00:00
|
|
|
const entry = {id: 2};
|
2020-02-24 11:20:53 +00:00
|
|
|
|
|
|
|
beforeEach(ngModule('entry'));
|
|
|
|
|
2020-04-30 10:48:52 +00:00
|
|
|
beforeEach(inject($componentController => {
|
|
|
|
controller = $componentController('vnEntryDescriptor', {$element: null}, {entry});
|
2020-02-24 11:20:53 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
describe('showEntryReport()', () => {
|
|
|
|
it('should open a new window showing a delivery note PDF document', () => {
|
2020-04-30 10:48:52 +00:00
|
|
|
controller.showReport = jest.fn();
|
|
|
|
|
2020-02-24 11:20:53 +00:00
|
|
|
const params = {
|
|
|
|
clientId: controller.vnConfig.storage.currentUserWorkerId,
|
2020-04-30 10:48:52 +00:00
|
|
|
entryId: entry.id
|
2020-02-24 11:20:53 +00:00
|
|
|
};
|
|
|
|
controller.showEntryReport();
|
|
|
|
|
2020-04-30 10:48:52 +00:00
|
|
|
expect(controller.showReport).toHaveBeenCalledWith('entry-order', params);
|
2020-02-24 11:20:53 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|