Skip to content

Commit

Permalink
Merge pull request esbanarango#27 from earayo/bugfix_types
Browse files Browse the repository at this point in the history
Bugfix types
  • Loading branch information
esbanarango authored Jun 21, 2016
2 parents 41309b9 + 9e176da commit d589a43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addon/components/place-autocomplete-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export default Component.extend({
},

_typesToArray() {
return this.get('types').split();
return this.get('types').split(',');
},

actions: {
focusOut() {
this._callCallback('focusOutCallback');
}
}
});
});
14 changes: 13 additions & 1 deletion tests/unit/components/place-autocomplete-field-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,17 @@ describeComponent(
component.set('types', 'geocode');
expect(component._typesToArray()).to.eql(['geocode']);
});

it('converts types option to array more two elements', function(){
var component = this.subject();
component.set('types', 'geocode,establishment');
expect(component._typesToArray()).to.eql(['geocode','establishment']);
});

it('converts types in an empty string', function(){
var component = this.subject();
component.set('types', '');
expect(component._typesToArray()).to.eql("");
});
}
);
);

0 comments on commit d589a43

Please sign in to comment.