fixed test

This commit is contained in:
Gerard 2018-10-08 12:02:05 +02:00
parent 16902fab8f
commit 7e2e2c9953
1 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ describe('Salix', () => {
describe('localBank() setter', () => {
it('should set window.localStorage.localBank and call showOk', () => {
spyOn(controller, 'showOk')
spyOn(controller, 'showOk');
controller.localBank = 4;
expect(window.localStorage.localBank).toBe('4');
@ -31,7 +31,7 @@ describe('Salix', () => {
describe('localWarehouse() setter', () => {
it('should set window.localStorage.localWarehouse and call showOk', () => {
spyOn(controller, 'showOk')
spyOn(controller, 'showOk');
controller.localWarehouse = 4;
expect(window.localStorage.localWarehouse).toBe('4');
@ -41,7 +41,7 @@ describe('Salix', () => {
describe('localCompany() setter', () => {
it('should set window.localStorage.localCompany and call showOk', () => {
spyOn(controller, 'showOk')
spyOn(controller, 'showOk');
controller.localCompany = 4;
expect(window.localStorage.localCompany).toBe('4');
@ -51,7 +51,7 @@ describe('Salix', () => {
describe('warehouseFk() setter', () => {
it('should set warehouse and call setUserConfig', () => {
spyOn(controller, 'setUserConfig')
spyOn(controller, 'setUserConfig');
controller.warehouseFk = 4;
expect(controller.warehouse).toBe(4);
@ -61,7 +61,7 @@ describe('Salix', () => {
describe('companyFk() setter', () => {
it('should set company and call setUserConfig', () => {
spyOn(controller, 'setUserConfig')
spyOn(controller, 'setUserConfig');
controller.companyFk = 4;
expect(controller.company).toBe(4);
@ -71,11 +71,11 @@ describe('Salix', () => {
describe('getUserConfig()', () => {
it('should make a query, set company and not set warehouse if its not in the response', () => {
$httpBackend.when('GET', `/api/UserConfigs/getUserConfig`).respond({response: {companyFk: 2}});
$httpBackend.when('GET', `/api/UserConfigs/getUserConfig`).respond({companyFk: 2});
$httpBackend.expect('GET', `/api/UserConfigs/getUserConfig`);
controller.getUserConfig();
$httpBackend.flush();
expect(controller.warehouse).toBeUndefined();
expect(controller.company).toEqual(2);
});
@ -89,7 +89,7 @@ describe('Salix', () => {
$httpBackend.expect('POST', `/api/UserConfigs/setUserConfig`, {companyFk: 1});
controller.setUserConfig('companyFk');
$httpBackend.flush();
expect(controller.showOk).toHaveBeenCalledWith();
});
});