Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 03:08:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 03:08:58 +0300
commit79216161b305b8d23b34226d45aa92dbae316cfe (patch)
treefbedafc415fcfb9970968ac17e94a443ce7ce477 /spec/frontend/environments
parentc1924b863ad66503edbaa3325949bce6b023b737 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/environments')
-rw-r--r--spec/frontend/environments/emtpy_state_spec.js40
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);
+ });
+ });
+});