29dc56c12f
* modify sort options for party members * add unittest for membersModalComponent sort * updates as requested in PR * removed duplicates for `class` and `background` from flavour text * fix linting error thrown by travis ci
32 lines
774 B
JavaScript
32 lines
774 B
JavaScript
import Vue from 'vue';
|
|
import MembersModalComponent from 'client/components/groups/membersModal.vue';
|
|
|
|
describe('Members Modal Component', () => {
|
|
describe('Party Sort', () => {
|
|
let CTor;
|
|
let vm;
|
|
|
|
beforeEach(() => {
|
|
CTor = Vue.extend(MembersModalComponent);
|
|
vm = new CTor().$mount();
|
|
});
|
|
|
|
afterEach(() => {
|
|
vm.$destroy();
|
|
});
|
|
|
|
it('should have an empty object as sort-option at start', () => {
|
|
const defaultData = vm.data();
|
|
expect(defaultData.sortOption).to.eq({});
|
|
});
|
|
|
|
it('should accept sort-option object', () => {
|
|
const sortOption = vm.data().sortOption[0];
|
|
vm.sort(sortOption);
|
|
Vue.nextTick(() => {
|
|
expect(vm.data().sortOption).to.eq(sortOption);
|
|
});
|
|
});
|
|
});
|
|
});
|