diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 03:08:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 03:08:58 +0300 |
commit | 79216161b305b8d23b34226d45aa92dbae316cfe (patch) | |
tree | fbedafc415fcfb9970968ac17e94a443ce7ce477 /spec/frontend/environments | |
parent | c1924b863ad66503edbaa3325949bce6b023b737 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/environments')
-rw-r--r-- | spec/frontend/environments/emtpy_state_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/frontend/environments/emtpy_state_spec.js b/spec/frontend/environments/emtpy_state_spec.js new file mode 100644 index 00000000000..ed90c13f1e1 --- /dev/null +++ b/spec/frontend/environments/emtpy_state_spec.js @@ -0,0 +1,40 @@ +import { shallowMount } from '@vue/test-utils'; +import EmptyState from '~/environments/components/empty_state.vue'; + +describe('environments empty state', () => { + let vm; + + beforeEach(() => { + vm = shallowMount(EmptyState, { + propsData: { + newPath: 'foo', + canCreateEnvironment: true, + helpPath: 'bar', + }, + }); + }); + + afterEach(() => { + vm.destroy(); + }); + + it('renders the empty state', () => { + expect(vm.find('.js-blank-state-title').text()).toEqual( + "You don't have any environments right now", + ); + }); + + it('renders the new environment button', () => { + expect(vm.find('.js-new-environment-button').attributes('href')).toEqual('foo'); + }); + + describe('without permission', () => { + beforeEach(() => { + vm.setProps({ canCreateEnvironment: false }); + }); + + it('does not render the new environment button', () => { + expect(vm.find('.js-new-environment-button').exists()).toBe(false); + }); + }); +}); |