提交 08800944 编写于 作者: A Alfredo Sumaran

Make GroupsStore.store method non-static

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册