Fix tests and eslint errors

[ci skip]
This commit is contained in:
Alfredo Sumaran 2017-05-30 04:26:46 -05:00
parent 0b594f6827
commit 41203686c3
4 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,5 @@
/* eslint-disable class-methods-use-this */
import Vue from 'vue';
import VueResource from 'vue-resource';

View File

@ -26,7 +26,7 @@ describe('Groups Component', () => {
it('should render the group item', () => {
expect(component.$el.classList.contains('group-row')).toBe(true);
expect(component.$el.querySelector('.number-projects').textContent).toContain(group.numberProjects);
expect(component.$el.querySelector('.number-members').textContent).toContain(group.numberMembers);
expect(component.$el.querySelector('.number-users').textContent).toContain(group.numberUsers);
expect(component.$el.querySelector('.group-visibility')).toBeDefined();
expect(component.$el.querySelector('.avatar-container')).toBeDefined();
expect(component.$el.querySelector('.title').textContent).toContain(group.name);

View File

@ -48,7 +48,7 @@ describe('Groups Component', () => {
expect(lists.length).toBe(3); // one parent and two subgroups
expect(lists[0].querySelector('#group-1119').classList.contains('is-open')).toBe(true);
expect(lists[0].querySelector('#group-1119').classList.contains('is-expandable')).toBe(true);
expect(lists[0].querySelector('#group-1119').classList.contains('has-subgroups')).toBe(true);
expect(lists[2].querySelector('#group-1120').textContent).toContain(groups[1119].subGroups[1120].name);
});

View File

@ -11,6 +11,9 @@ const group1 = {
parent_id: null,
created_at: '2017-05-15T19:01:23.670Z',
updated_at: '2017-05-15T19:01:23.670Z',
number_projects: '1',
number_users: '1',
has_subgroups: true,
permissions: {
group_access: 50,
},
@ -30,6 +33,9 @@ const group14 = {
parent_id: 1127,
created_at: '2017-05-15T19:02:01.645Z',
updated_at: '2017-05-15T19:02:01.645Z',
number_projects: '1',
number_users: '1',
has_subgroups: true,
permissions: {
group_access: 30,
},
@ -48,6 +54,9 @@ const group2 = {
parent_id: null,
created_at: '2017-05-11T19:35:09.635Z',
updated_at: '2017-05-11T19:35:09.635Z',
number_projects: '1',
number_users: '1',
has_subgroups: true,
permissions: {
group_access: 50,
},
@ -66,6 +75,9 @@ const group21 = {
parent_id: 1119,
created_at: '2017-05-11T19:51:04.060Z',
updated_at: '2017-05-11T19:51:04.060Z',
number_projects: '1',
number_users: '1',
has_subgroups: true,
permissions: {
group_access: 50,
},