Party roster sorter: Member Modal Component (#9472)
* 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
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user