Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix gh-selectize-test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinansfield authored and acburdine committed Feb 1, 2017
1 parent 7f584b3 commit 51f444c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/unit/components/gh-selectize-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ describe('Unit: Component: gh-selectize', function () {
it('re-orders selection when selectize order is changed', function () {
let component = this.subject();

let item1 = {id: '1', name: 'item 1'};
let item2 = {id: '2', name: 'item 2'};
let item3 = {id: '3', name: 'item 3'};

run(() => {
component.set('content', emberA(['item 1', 'item 2', 'item 3']));
component.set('selection', emberA(['item 2', 'item 3']));
component.set('content', emberA([item1, item2, item3]));
component.set('selection', emberA([item2, item3]));
component.set('multiple', true);
component.set('optionValuePath', 'content.id');
component.set('optionLabelPath', 'content.name');
});

this.render();

run(() => {
component._selectize.setValue(['item 3', 'item 2']);
component._selectize.setValue(['3', '2']);
});

expect(component.get('value').toArray(), 'component value').to.deep.equal(['item 3', 'item 2']);
expect(component.get('selection').toArray(), 'component selection').to.deep.equal(['item 3', 'item 2']);
expect(component.get('selection').toArray(), 'component selection').to.deep.equal([item3, item2]);
});
});

0 comments on commit 51f444c

Please sign in to comment.