Skip to content

Commit

Permalink
modal opens even when options are undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
mminkoff committed Jul 5, 2017
1 parent 110b6a3 commit 3cf89f4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addon/components/ember-filestack-picker/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default Ember.Component.extend({
openFilepicker: on('didInsertElement', function () {
scheduleOnce('afterRender', this, function () {
this.get('filestack.promise').then((filestack) => {
let options = this.get('options');
let options = this.get('options') || {};
options['onClose'] = options['onClose'] || this.getCallClose();
filestack.pick(options).then((data) => {
this.send('handleSelection', data);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-filestack",
"version": "0.0.4",
"version": "0.0.5",
"description": "Ember Addon for https://filestack.com support",
"keywords": [
"ember-addon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ test('it renders', function (assert) {
});
});

test('it renders with undefined options', function (assert) {
this.set('options', undefined);

this.render(hbs`{{ember-filestack-picker options=options}}`);

return wait().then(function () {
assert.equal(window.$('.fsp-picker').length, 1, 'pick modal is open');

// close any open pickers
window.$('.fsp-picker__close-button').click();
});
});

test('it calls onClose', function (assert) {
this.set('options', {fromSources: 'local_file_system'});
this.set('onClose', () => {
Expand Down

0 comments on commit 3cf89f4

Please sign in to comment.