summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-05-18 15:33:52 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-05-18 15:33:52 +0800
commit54a8cbddb16338bf48aa04143566ccd33646d769 (patch)
tree82fe3eb4b1b6a8bade602f8f17e488564e6cd2a7 /spec/javascripts
parent226b517ce70674a1c25084b8535dd6869addb21e (diff)
parentc9e61fa3cd8eeb63aced9a55039dc4d17616cd42 (diff)
downloadgitlab-ce-54a8cbddb16338bf48aa04143566ccd33646d769.tar.gz
Merge remote-tracking branch 'upstream/master' into rename-builds-controller
* upstream/master: (31 commits) Remove 'no changes' entries from changelog Check if OLD is set when migrating issue assignees Fix data migration from trigger schedules Replace EFS section in AWS guide Add warning about AWS EFS and performance Consolidate opening text from about.gitlab.com and add active/passive note Fix invalid object reference in ee_compat_check script Fix Ordered Task List Items Add auxiliary viewer for README Update fe_guide testing.md Add auxiliary blob viewer for CHANGELOG Add spec for last commit info when browsing repository files Show last commit for current tree on tree page Use same last commit widget on project homepage and tree view Fix unassigned checkmark Add missing changelog for iPython notebook rendering feature Convert fa-history to svg; tweak alignment Get rid of pluck in app/services/members/authorized_destroy_service.rb Removes duplicate environment variable in documentation Fixed spacing issues in issue sidebar ...
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js b/spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js
index d40c67b189d..a8a02fa6b66 100644
--- a/spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js
+++ b/spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js
@@ -4,14 +4,26 @@ import nothingToMergeComponent from '~/vue_merge_request_widget/components/state
describe('MRWidgetNothingToMerge', () => {
describe('template', () => {
const Component = Vue.extend(nothingToMergeComponent);
+ const newBlobPath = '/foo';
const vm = new Component({
el: document.createElement('div'),
+ propsData: {
+ mr: { newBlobPath },
+ },
});
+
it('should have correct elements', () => {
expect(vm.$el.classList.contains('mr-widget-body')).toBeTruthy();
- expect(vm.$el.querySelector('button').getAttribute('disabled')).toBeTruthy();
- expect(vm.$el.innerText).toContain('There is nothing to merge from source branch into target branch.');
+ expect(vm.$el.querySelector('a').href).toContain(newBlobPath);
+ expect(vm.$el.innerText).toContain('Currently there are no changes in this merge request\'s source branch');
expect(vm.$el.innerText).toContain('Please push new commits or use a different branch.');
});
+
+ it('should not show new blob link if there is no link available', () => {
+ vm.mr.newBlobPath = null;
+ Vue.nextTick(() => {
+ expect(vm.$el.querySelector('a')).toEqual(null);
+ });
+ });
});
});