Commit 41203686 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Fix tests and eslint errors

[ci skip]
parent 0b594f68
/* eslint-disable class-methods-use-this */
import Vue from 'vue'; import Vue from 'vue';
import VueResource from 'vue-resource'; import VueResource from 'vue-resource';
......
...@@ -26,7 +26,7 @@ describe('Groups Component', () => { ...@@ -26,7 +26,7 @@ describe('Groups Component', () => {
it('should render the group item', () => { it('should render the group item', () => {
expect(component.$el.classList.contains('group-row')).toBe(true); expect(component.$el.classList.contains('group-row')).toBe(true);
expect(component.$el.querySelector('.number-projects').textContent).toContain(group.numberProjects); 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('.group-visibility')).toBeDefined();
expect(component.$el.querySelector('.avatar-container')).toBeDefined(); expect(component.$el.querySelector('.avatar-container')).toBeDefined();
expect(component.$el.querySelector('.title').textContent).toContain(group.name); expect(component.$el.querySelector('.title').textContent).toContain(group.name);
......
...@@ -48,7 +48,7 @@ describe('Groups Component', () => { ...@@ -48,7 +48,7 @@ describe('Groups Component', () => {
expect(lists.length).toBe(3); // one parent and two subgroups 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-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); expect(lists[2].querySelector('#group-1120').textContent).toContain(groups[1119].subGroups[1120].name);
}); });
......
...@@ -11,6 +11,9 @@ const group1 = { ...@@ -11,6 +11,9 @@ const group1 = {
parent_id: null, parent_id: null,
created_at: '2017-05-15T19:01:23.670Z', created_at: '2017-05-15T19:01:23.670Z',
updated_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: { permissions: {
group_access: 50, group_access: 50,
}, },
...@@ -30,6 +33,9 @@ const group14 = { ...@@ -30,6 +33,9 @@ const group14 = {
parent_id: 1127, parent_id: 1127,
created_at: '2017-05-15T19:02:01.645Z', created_at: '2017-05-15T19:02:01.645Z',
updated_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: { permissions: {
group_access: 30, group_access: 30,
}, },
...@@ -48,6 +54,9 @@ const group2 = { ...@@ -48,6 +54,9 @@ const group2 = {
parent_id: null, parent_id: null,
created_at: '2017-05-11T19:35:09.635Z', created_at: '2017-05-11T19:35:09.635Z',
updated_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: { permissions: {
group_access: 50, group_access: 50,
}, },
...@@ -66,6 +75,9 @@ const group21 = { ...@@ -66,6 +75,9 @@ const group21 = {
parent_id: 1119, parent_id: 1119,
created_at: '2017-05-11T19:51:04.060Z', created_at: '2017-05-11T19:51:04.060Z',
updated_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: { permissions: {
group_access: 50, group_access: 50,
}, },
......
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