import './index.js'; fdescribe('InvoiceIn', () => { describe('Component vnInvoiceInCreate', () => { let controller; let $element; beforeEach(ngModule('invoiceIn')); beforeEach(inject(($componentController, $compile, $rootScope) => { $element = angular.element(``); console.log($element); controller = $componentController('vnInvoiceInCreate', {$element}); // controller = $element.controller('Controller'); })); afterEach(() => { $element.remove(); }); describe('onSubmit()', () => { it(`should call createInvoiceIn()`, () => { jest.spyOn(controller, 'createInvoiceIn'); controller.onSubmit(); expect(controller.createInvoiceIn).toHaveBeenCalledWith(); }); }); describe('onInit()', () => { it(`should define invoiceIn supplierFk with params values()`, () => { controller.params = 'supplierId'; controller.$onInit(); expect(controller.invoiceIn.supplierFk).toEqual('supplierId'); }); }); describe('set companyFk', () => { it(`should set companyFk to a value`, () => { console.log(controller); controller.companyFk = 442; expect(controller.companyFk).toEqual(442); }); }); }); });