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 { export default class GroupsStore {
constructor() { constructor() {
this.state = {}; this.state = {};
...@@ -104,11 +103,11 @@ export default class GroupsStore { ...@@ -104,11 +103,11 @@ export default class GroupsStore {
} }
decorateGroups(rawGroups) { decorateGroups(rawGroups) {
this.groups = rawGroups.map(GroupsStore.decorateGroup); this.groups = rawGroups.map(this.decorateGroup);
return this.groups; return this.groups;
} }
static decorateGroup(rawGroup) { decorateGroup(rawGroup) {
return { return {
id: rawGroup.id, id: rawGroup.id,
fullName: rawGroup.full_name, fullName: rawGroup.full_name,
...@@ -130,6 +129,7 @@ export default class GroupsStore { ...@@ -130,6 +129,7 @@ export default class GroupsStore {
}; };
} }
// eslint-disable-next-line class-methods-use-this
static toggleSubGroups(toggleGroup) { static toggleSubGroups(toggleGroup) {
const group = toggleGroup; const group = toggleGroup;
group.isOpen = !group.isOpen; group.isOpen = !group.isOpen;
......
...@@ -6,11 +6,13 @@ import { group1 } from './mock_data'; ...@@ -6,11 +6,13 @@ import { group1 } from './mock_data';
describe('Groups Component', () => { describe('Groups Component', () => {
let GroupItemComponent; let GroupItemComponent;
let component; let component;
let store;
let group; let group;
beforeEach((done) => { beforeEach((done) => {
GroupItemComponent = Vue.extend(groupItemComponent); GroupItemComponent = Vue.extend(groupItemComponent);
group = GroupsStore.decorateGroup(group1); store = new GroupsStore();
group = store.decorateGroup(group1);
component = new GroupItemComponent({ component = new GroupItemComponent({
propsData: { 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