diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-07-21 15:49:37 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-01 10:21:09 +0200 |
commit | 1e668a3cfebfcf576a8c5da834bad094fd9039f6 (patch) | |
tree | 405caed1e99ae5f642c9f363d793b3a9a64c4dd1 /spec/javascripts/groups/group_item_spec.js | |
parent | bf4ec606a56238326bf4930c59d0ca82dd281cb7 (diff) | |
download | gitlab-ce-1e668a3cfebfcf576a8c5da834bad094fd9039f6.tar.gz |
Rework subgroup endpointbvl-show-projects-in-group-tree
Diffstat (limited to 'spec/javascripts/groups/group_item_spec.js')
-rw-r--r-- | spec/javascripts/groups/group_item_spec.js | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/spec/javascripts/groups/group_item_spec.js b/spec/javascripts/groups/group_item_spec.js index 25e10552d95..78eeface95c 100644 --- a/spec/javascripts/groups/group_item_spec.js +++ b/spec/javascripts/groups/group_item_spec.js @@ -33,6 +33,7 @@ describe('Groups Component', () => { it('should render the group item correctly', () => { expect(component.$el.classList.contains('group-row')).toBe(true); expect(component.$el.classList.contains('.no-description')).toBe(false); + expect(component.$el.querySelector('.number-subgroups').textContent).toContain(group.subGroupCount); expect(component.$el.querySelector('.number-projects').textContent).toContain(group.numberProjects); expect(component.$el.querySelector('.number-users').textContent).toContain(group.numberUsers); expect(component.$el.querySelector('.group-visibility')).toBeDefined(); @@ -43,6 +44,13 @@ describe('Groups Component', () => { expect(component.$el.querySelector('.edit-group')).toBeDefined(); expect(component.$el.querySelector('.leave-group')).toBeDefined(); }); + + it('should render tooltips on group item correctly', () => { + expect(component.$el.querySelector('.number-subgroups').dataset.originalTitle).toContain('Subgroups'); + expect(component.$el.querySelector('.number-projects').dataset.originalTitle).toContain('Projects'); + expect(component.$el.querySelector('.number-users').dataset.originalTitle).toContain('Members'); + expect(component.$el.querySelector('.group-visibility').dataset.originalTitle).toContain('Public'); + }); }); describe('group without description', () => { @@ -68,7 +76,7 @@ describe('Groups Component', () => { }); it('should render group item correctly', () => { - expect(component.$el.querySelector('.description').textContent).toBe(''); + expect(component.$el.querySelector('.description')).toBe(null); expect(component.$el.classList.contains('.no-description')).toBe(false); }); }); @@ -99,4 +107,33 @@ describe('Groups Component', () => { expect(component.$el.querySelector('.access-type')).toBeNull(); }); }); + + describe('group with projects', () => { + beforeEach((done) => { + GroupItemComponent = Vue.extend(groupItemComponent); + store = new GroupsStore(); + group1.permissions.human_group_access = null; + group = store.decorateGroup(group1); + group.isOpen = true; + + component = new GroupItemComponent({ + propsData: { + group, + }, + }).$mount(); + + Vue.nextTick(() => { + done(); + }); + }); + + afterEach(() => { + component.$destroy(); + }); + + it('should render projects list correctly', () => { + expect(component.$el.querySelector('.group-list-tree.project-list')).toBeDefined(); + expect(component.$el.querySelectorAll('.group-list-tree.project-list .project-row').length).toBe(1); + }); + }); }); |