summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-11-13 22:44:14 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-11-13 22:44:14 +0000
commitda521deb5fa8bf48a3f26805468362e7b7ca71a8 (patch)
tree1878a985a34f2b33fbd3f878069b609479c07809 /spec
parenta4729ffad59dd12bde8c938af09fe4a2235445b6 (diff)
parent73d3cb8c8995f4c3a875183adbb0e43d6c795759 (diff)
downloadgitlab-ce-da521deb5fa8bf48a3f26805468362e7b7ca71a8.tar.gz
Merge branch 'enable-image-comments-for-renamed-files' into 'master'
Fixed image commenting on moved files See merge request gitlab-org/gitlab-ce!23023
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js b/spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
index 2d3e178d249..7f2e246d656 100644
--- a/spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
+++ b/spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
@@ -97,6 +97,26 @@ describe('ImageDiffViewer', () => {
});
});
+ it('renders image diff for renamed', done => {
+ vm = new Vue({
+ components: {
+ imageDiffViewer,
+ },
+ template: `
+ <image-diff-viewer diff-mode="renamed" new-path="${GREEN_BOX_IMAGE_URL}" old-path="">
+ <span slot="image-overlay" class="overlay">test</span>
+ </image-diff-viewer>
+ `,
+ }).$mount();
+
+ setTimeout(() => {
+ expect(vm.$el.querySelector('img').getAttribute('src')).toBe(GREEN_BOX_IMAGE_URL);
+ expect(vm.$el.querySelector('.overlay')).not.toBe(null);
+
+ done();
+ });
+ });
+
describe('swipeMode', () => {
beforeEach(done => {
createComponent({