diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-06-08 03:45:18 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-06-08 03:45:18 -0500 |
commit | c24b70682448f23d7eb01853026cfe6abdf86190 (patch) | |
tree | 6e7d66be0f1d1f4c2fcbc6e6d281f3510402b70b /spec | |
parent | f427bf42f178add4cc1eb0758be920b357846383 (diff) | |
download | gitlab-ce-c24b70682448f23d7eb01853026cfe6abdf86190.tar.gz |
Add tests when user has no direct acces to a group
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/groups/group_item_spec.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/javascripts/groups/group_item_spec.js b/spec/javascripts/groups/group_item_spec.js index 73ea86e6756..25e10552d95 100644 --- a/spec/javascripts/groups/group_item_spec.js +++ b/spec/javascripts/groups/group_item_spec.js @@ -63,9 +63,40 @@ describe('Groups Component', () => { }); }); + afterEach(() => { + component.$destroy(); + }); + it('should render group item correctly', () => { expect(component.$el.querySelector('.description').textContent).toBe(''); expect(component.$el.classList.contains('.no-description')).toBe(false); }); }); + + describe('user has not access to group', () => { + beforeEach((done) => { + GroupItemComponent = Vue.extend(groupItemComponent); + store = new GroupsStore(); + group1.permissions.human_group_access = null; + group = store.decorateGroup(group1); + + component = new GroupItemComponent({ + propsData: { + group, + }, + }).$mount(); + + Vue.nextTick(() => { + done(); + }); + }); + + afterEach(() => { + component.$destroy(); + }); + + it('should not display access type', () => { + expect(component.$el.querySelector('.access-type')).toBeNull(); + }); + }); }); |