fix gh-selectize-test

This commit is contained in:
Kevin Ansfield 2017-01-31 21:15:17 +00:00 committed by Austin Burdine
parent 11a06e7d19
commit 7e14378a63

View File

@ -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]);
});
});