fixed test
This commit is contained in:
parent
16902fab8f
commit
7e2e2c9953
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue