summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_pipelines_index/empty_state_spec.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-03-20 15:36:02 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-03-20 16:16:19 +0000
commit446b59dd4ee88f8ef86272c39408560a0107c48a (patch)
treedc6eef4b89111775dd4176f6db08fd95af57c293 /spec/javascripts/vue_pipelines_index/empty_state_spec.js
parent2c85a20482c2e33f307ad8faf60e41e199aa25b8 (diff)
downloadgitlab-ce-446b59dd4ee88f8ef86272c39408560a0107c48a.tar.gz
Adds tests to new empty and error states
Diffstat (limited to 'spec/javascripts/vue_pipelines_index/empty_state_spec.js')
-rw-r--r--spec/javascripts/vue_pipelines_index/empty_state_spec.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/javascripts/vue_pipelines_index/empty_state_spec.js b/spec/javascripts/vue_pipelines_index/empty_state_spec.js
new file mode 100644
index 00000000000..733337168dc
--- /dev/null
+++ b/spec/javascripts/vue_pipelines_index/empty_state_spec.js
@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import emptyStateComp from '~/vue_pipelines_index/components/empty_state';
+
+describe('Pipelines Empty State', () => {
+ let component;
+ let EmptyStateComponent;
+
+ beforeEach(() => {
+ EmptyStateComponent = Vue.extend(emptyStateComp);
+
+ component = new EmptyStateComponent({
+ propsData: {
+ helpPagePath: 'foo',
+ },
+ }).$mount();
+ });
+
+ it('should render empty state SVG', () => {
+ expect(component.$el.querySelector('.svg-content svg')).toBeDefined();
+ });
+
+ it('should render emtpy state information', () => {
+ expect(component.$el.querySelector('h4').textContent).toContain('Build with confidence');
+
+ expect(
+ component.$el.querySelector('p').textContent,
+ ).toContain('Continous Integration can help catch bugs by running your tests automatically');
+
+ expect(
+ component.$el.querySelector('p').textContent,
+ ).toContain('Continuous Deployment can help you deliver code to your product environment');
+ });
+
+ it('should render a link with provided help path', () => {
+ expect(component.$el.querySelector('.btn-info').getAttribute('href')).toEqual('foo');
+ expect(component.$el.querySelector('.btn-info').textContent).toContain('Get started with Pipelines');
+ });
+});