From 2ee5991b42717969af93cb30d863aafab04dff8a Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Jan 2020 09:08:32 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../markdown/suggestion_diff_row_spec.js | 46 ++++++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'spec/frontend/vue_shared') diff --git a/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js b/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js index 97fcdc67791..6ae405017c9 100644 --- a/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js +++ b/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js @@ -63,21 +63,59 @@ describe('SuggestionDiffRow', () => { it('renders the plain text when it is available but rich text is not', () => { factory({ propsData: { - line: Object.assign({}, newLine, { rich_text: undefined }), + line: { + ...newLine, + rich_text: undefined, + }, }, }); expect(wrapper.find('td.line_content').text()).toEqual('newplaintext'); }); - it('renders a zero-width space when it has no plain or rich texts', () => { + it('switches to table-cell display when it has no plain or rich texts', () => { factory({ propsData: { - line: Object.assign({}, newLine, { rich_text: undefined, text: undefined }), + line: { + ...newLine, + text: undefined, + rich_text: undefined, + }, }, }); - expect(wrapper.find('td.line_content').text()).toEqual('\u200B'); + const lineContent = wrapper.find('td.line_content'); + + expect(lineContent.classes()).toContain('d-table-cell'); + expect(lineContent.text()).toEqual(''); + }); + + it('does not switch to table-cell display if it has either plain or rich texts', () => { + let lineContent; + + factory({ + propsData: { + line: { + ...newLine, + text: undefined, + }, + }, + }); + + lineContent = wrapper.find('td.line_content'); + expect(lineContent.classes()).not.toContain('d-table-cell'); + + factory({ + propsData: { + line: { + ...newLine, + rich_text: undefined, + }, + }, + }); + + lineContent = wrapper.find('td.line_content'); + expect(lineContent.classes()).not.toContain('d-table-cell'); }); }); -- cgit v1.2.3