Commit 08800944 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Make GroupsStore.store method non-static

parent 76543bce
/* eslint-disable class-methods-use-this */
export default class GroupsStore {
constructor() {
this.state = {};
......@@ -104,11 +103,11 @@ export default class GroupsStore {
}
decorateGroups(rawGroups) {
this.groups = rawGroups.map(GroupsStore.decorateGroup);
this.groups = rawGroups.map(this.decorateGroup);
return this.groups;
}
static decorateGroup(rawGroup) {
decorateGroup(rawGroup) {
return {
id: rawGroup.id,
fullName: rawGroup.full_name,
......@@ -130,6 +129,7 @@ export default class GroupsStore {
};
}
// eslint-disable-next-line class-methods-use-this
static toggleSubGroups(toggleGroup) {
const group = toggleGroup;
group.isOpen = !group.isOpen;
......
......@@ -6,11 +6,13 @@ import { group1 } from './mock_data';
describe('Groups Component', () => {
let GroupItemComponent;
let component;
let store;
let group;
beforeEach((done) => {
GroupItemComponent = Vue.extend(groupItemComponent);
group = GroupsStore.decorateGroup(group1);
store = new GroupsStore();
group = store.decorateGroup(group1);
component = new GroupItemComponent({
propsData: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment