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-01-20 12:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-20 12:08:32 +0300
commit2ee5991b42717969af93cb30d863aafab04dff8a (patch)
treec09c0b7b4d02ceb9d6ac090c1ccfb93effb8a368 /spec/frontend/vue_shared
parent6b1ba27ef7373815ea29dc5b80eab846c8acd022 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r--spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js46
1 files changed, 42 insertions, 4 deletions
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');
});
});