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-02-17 18:09:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 18:09:01 +0300
commitb304a72312465ed4c0a568ee6a6ea5e97f705c9b (patch)
treea2f25dbea26c81e88b169c55a6275e3969323e82 /spec/frontend/vue_mr_widget
parentb84eeb256c4a780d902faee1f99ca9a711b3214a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_mr_widget')
-rw-r--r--spec/frontend/vue_mr_widget/components/mr_widget_suggest_pipeline_spec.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/spec/frontend/vue_mr_widget/components/mr_widget_suggest_pipeline_spec.js b/spec/frontend/vue_mr_widget/components/mr_widget_suggest_pipeline_spec.js
new file mode 100644
index 00000000000..77293a5b187
--- /dev/null
+++ b/spec/frontend/vue_mr_widget/components/mr_widget_suggest_pipeline_spec.js
@@ -0,0 +1,52 @@
+import { mount } from '@vue/test-utils';
+import { GlLink } from '@gitlab/ui';
+import suggestPipelineComponent from '~/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue';
+import MrWidgetIcon from '~/vue_merge_request_widget/components/mr_widget_icon.vue';
+
+describe('MRWidgetHeader', () => {
+ let wrapper;
+ const pipelinePath = '/foo/bar/add/pipeline/path';
+ const iconName = 'status_notfound';
+
+ beforeEach(() => {
+ wrapper = mount(suggestPipelineComponent, {
+ propsData: { pipelinePath },
+ });
+ });
+
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
+ describe('template', () => {
+ it('renders add pipeline file link', () => {
+ const link = wrapper.find(GlLink);
+
+ return wrapper.vm.$nextTick().then(() => {
+ expect(link.exists()).toBe(true);
+ expect(link.attributes().href).toBe(pipelinePath);
+ });
+ });
+
+ it('renders the expected text', () => {
+ const messageText = /\s*No pipeline\s*Add the .gitlab-ci.yml file\s*to create one./;
+
+ return wrapper.vm.$nextTick().then(() => {
+ expect(wrapper.text()).toMatch(messageText);
+ });
+ });
+
+ it('renders widget icon', () => {
+ const icon = wrapper.find(MrWidgetIcon);
+
+ return wrapper.vm.$nextTick().then(() => {
+ expect(icon.exists()).toBe(true);
+ expect(icon.props()).toEqual(
+ expect.objectContaining({
+ name: iconName,
+ }),
+ );
+ });
+ });
+ });
+});