more tests

This commit is contained in:
Carlos 2017-09-27 08:09:10 +02:00
parent 0a17a59f2d
commit 959f09d272
1 changed files with 21 additions and 2 deletions

View File

@ -71,10 +71,29 @@ describe('Component vnAutocomplete', () => {
controller.field = {name: 'Bruce Wayne'};
expect(controller._multiField).toEqual([]);
// value is still stored in _field after second call... is this correct? or should be deleted as per _multifield? ask Dani!
expect(controller._field).toEqual('Bruce Wayne');
});
});
describe('when value is not an object', () => { // not sure if it isnt an object actually
it(`should set _field value`, () => {
let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout});
controller.valueField = 'name';
controller.items = [{name: 'test1'}, {name: 'test2'}];
// controller.field = 6; puede ser cualquier cosa
// // request datasources.development.json to Vicente to carry on
// // let json = find out the value of json stringify
// // let url = find out the url for get endpoint
// controller.field = {name: 'Bruce Wayne'};
// // same URL for requests
// $httpBackend.when('GET', `localhost:5000?filter=Bruce`).respond('done');
// $httpBackend.expectGET(`localhost:5000?filter=Bruce`, {name: 'Bruce Wayne'});
// // any value to be defined before the flush?
// $httpBackend.flush();
});
});
});
});