summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js
diff options
context:
space:
mode:
authorRegis <boudinot.regis@yahoo.com>2017-03-21 09:08:28 -0600
committerRegis <boudinot.regis@yahoo.com>2017-03-21 09:08:28 -0600
commit0b75b821c6cfd173291fcfd88c41da9922d082dd (patch)
tree41b578d299bd77423aa3591955a4cb5ca07ab025 /spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js
parent6342da7bb6cbba1b1e026fc62a1da42b811b25f4 (diff)
parenta08c707c928092426e2334423e71c6b841309ddf (diff)
downloadgitlab-ce-issue-title-vue.tar.gz
update to current master and fix conflictsissue-title-vue
Diffstat (limited to 'spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js')
-rw-r--r--spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js b/spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js
new file mode 100644
index 00000000000..f7f49649c1c
--- /dev/null
+++ b/spec/javascripts/vue_pipelines_index/pipelines_artifacts_spec.js
@@ -0,0 +1,40 @@
+import Vue from 'vue';
+import artifactsComp from '~/vue_pipelines_index/components/pipelines_artifacts';
+
+describe('Pipelines Artifacts dropdown', () => {
+ let component;
+ let artifacts;
+
+ beforeEach(() => {
+ const ArtifactsComponent = Vue.extend(artifactsComp);
+
+ artifacts = [
+ {
+ name: 'artifact',
+ path: '/download/path',
+ },
+ ];
+
+ component = new ArtifactsComponent({
+ propsData: {
+ artifacts,
+ },
+ }).$mount();
+ });
+
+ it('should render a dropdown with the provided artifacts', () => {
+ expect(
+ component.$el.querySelectorAll('.dropdown-menu li').length,
+ ).toEqual(artifacts.length);
+ });
+
+ it('should render a link with the provided path', () => {
+ expect(
+ component.$el.querySelector('.dropdown-menu li a').getAttribute('href'),
+ ).toEqual(artifacts[0].path);
+
+ expect(
+ component.$el.querySelector('.dropdown-menu li a span').textContent,
+ ).toContain(artifacts[0].name);
+ });
+});