summaryrefslogtreecommitdiff
path: root/spec/frontend/jobs/components/empty_state_spec.js
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2019-08-06 15:07:18 +1000
committerSimon Knox <psimyn@gmail.com>2019-08-06 15:07:18 +1000
commitfc77b9df8b6a49c86e9c1eb949f1b1162470d2ee (patch)
tree96aad0a31543fa520626dc1c5efabff1367a0bab /spec/frontend/jobs/components/empty_state_spec.js
parent9c71bf3e6df2dcb20ea19df21a127823bbe5e615 (diff)
parentfa216b0e86433192ba4e39a05f42217fb4685173 (diff)
downloadgitlab-ce-fc77b9df8b6a49c86e9c1eb949f1b1162470d2ee.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into alerts-dropdown-to-modal-part-2-cealerts-dropdown-to-modal-part-2-ce
Diffstat (limited to 'spec/frontend/jobs/components/empty_state_spec.js')
-rw-r--r--spec/frontend/jobs/components/empty_state_spec.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/frontend/jobs/components/empty_state_spec.js b/spec/frontend/jobs/components/empty_state_spec.js
index a2df79bdda0..dfba5a936ee 100644
--- a/spec/frontend/jobs/components/empty_state_spec.js
+++ b/spec/frontend/jobs/components/empty_state_spec.js
@@ -10,6 +10,8 @@ describe('Empty State', () => {
illustrationPath: 'illustrations/pending_job_empty.svg',
illustrationSizeClass: 'svg-430',
title: 'This job has not started yet',
+ playable: false,
+ variablesSettingsUrl: '',
};
const content = 'This job is in pending state and is waiting to be picked by a runner';
@@ -90,4 +92,44 @@ describe('Empty State', () => {
expect(vm.$el.querySelector('.js-job-empty-state-action')).toBeNull();
});
});
+
+ describe('without playbale action', () => {
+ it('does not render manual variables form', () => {
+ vm = mountComponent(Component, {
+ ...props,
+ content,
+ });
+
+ expect(vm.$el.querySelector('.js-manual-vars-form')).toBeNull();
+ });
+ });
+
+ describe('with playbale action and not scheduled job', () => {
+ it('renders manual variables form', () => {
+ vm = mountComponent(Component, {
+ ...props,
+ content,
+ playable: true,
+ scheduled: false,
+ action: {
+ path: 'runner',
+ button_title: 'Check runner',
+ method: 'post',
+ },
+ });
+
+ expect(vm.$el.querySelector('.js-manual-vars-form')).not.toBeNull();
+ });
+ });
+
+ describe('with playbale action and scheduled job', () => {
+ it('does not render manual variables form', () => {
+ vm = mountComponent(Component, {
+ ...props,
+ content,
+ });
+
+ expect(vm.$el.querySelector('.js-manual-vars-form')).toBeNull();
+ });
+ });
});