fixed test
This commit is contained in:
parent
16902fab8f
commit
7e2e2c9953
|
@ -21,7 +21,7 @@ describe('Salix', () => {
|
||||||
|
|
||||||
describe('localBank() setter', () => {
|
describe('localBank() setter', () => {
|
||||||
it('should set window.localStorage.localBank and call showOk', () => {
|
it('should set window.localStorage.localBank and call showOk', () => {
|
||||||
spyOn(controller, 'showOk')
|
spyOn(controller, 'showOk');
|
||||||
controller.localBank = 4;
|
controller.localBank = 4;
|
||||||
|
|
||||||
expect(window.localStorage.localBank).toBe('4');
|
expect(window.localStorage.localBank).toBe('4');
|
||||||
|
@ -31,7 +31,7 @@ describe('Salix', () => {
|
||||||
|
|
||||||
describe('localWarehouse() setter', () => {
|
describe('localWarehouse() setter', () => {
|
||||||
it('should set window.localStorage.localWarehouse and call showOk', () => {
|
it('should set window.localStorage.localWarehouse and call showOk', () => {
|
||||||
spyOn(controller, 'showOk')
|
spyOn(controller, 'showOk');
|
||||||
controller.localWarehouse = 4;
|
controller.localWarehouse = 4;
|
||||||
|
|
||||||
expect(window.localStorage.localWarehouse).toBe('4');
|
expect(window.localStorage.localWarehouse).toBe('4');
|
||||||
|
@ -41,7 +41,7 @@ describe('Salix', () => {
|
||||||
|
|
||||||
describe('localCompany() setter', () => {
|
describe('localCompany() setter', () => {
|
||||||
it('should set window.localStorage.localCompany and call showOk', () => {
|
it('should set window.localStorage.localCompany and call showOk', () => {
|
||||||
spyOn(controller, 'showOk')
|
spyOn(controller, 'showOk');
|
||||||
controller.localCompany = 4;
|
controller.localCompany = 4;
|
||||||
|
|
||||||
expect(window.localStorage.localCompany).toBe('4');
|
expect(window.localStorage.localCompany).toBe('4');
|
||||||
|
@ -51,7 +51,7 @@ describe('Salix', () => {
|
||||||
|
|
||||||
describe('warehouseFk() setter', () => {
|
describe('warehouseFk() setter', () => {
|
||||||
it('should set warehouse and call setUserConfig', () => {
|
it('should set warehouse and call setUserConfig', () => {
|
||||||
spyOn(controller, 'setUserConfig')
|
spyOn(controller, 'setUserConfig');
|
||||||
controller.warehouseFk = 4;
|
controller.warehouseFk = 4;
|
||||||
|
|
||||||
expect(controller.warehouse).toBe(4);
|
expect(controller.warehouse).toBe(4);
|
||||||
|
@ -61,7 +61,7 @@ describe('Salix', () => {
|
||||||
|
|
||||||
describe('companyFk() setter', () => {
|
describe('companyFk() setter', () => {
|
||||||
it('should set company and call setUserConfig', () => {
|
it('should set company and call setUserConfig', () => {
|
||||||
spyOn(controller, 'setUserConfig')
|
spyOn(controller, 'setUserConfig');
|
||||||
controller.companyFk = 4;
|
controller.companyFk = 4;
|
||||||
|
|
||||||
expect(controller.company).toBe(4);
|
expect(controller.company).toBe(4);
|
||||||
|
@ -71,7 +71,7 @@ describe('Salix', () => {
|
||||||
|
|
||||||
describe('getUserConfig()', () => {
|
describe('getUserConfig()', () => {
|
||||||
it('should make a query, set company and not set warehouse if its not in the response', () => {
|
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`);
|
$httpBackend.expect('GET', `/api/UserConfigs/getUserConfig`);
|
||||||
controller.getUserConfig();
|
controller.getUserConfig();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
Loading…
Reference in New Issue