summaryrefslogtreecommitdiff
path: root/spec/javascripts/issue_show/components/description_spec.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-06-20 10:56:18 +0100
committerPhil Hughes <me@iamphill.com>2017-06-20 10:58:07 +0100
commit5dc253f138a8a2e333bcc8901087cc660bef05cc (patch)
tree4c7bc80486e5d20af0371320095f7264d42c14ae /spec/javascripts/issue_show/components/description_spec.js
parentbf57a7e80c44080dc7ec0fd774148afdae29cc31 (diff)
downloadgitlab-ce-5dc253f138a8a2e333bcc8901087cc660bef05cc.tar.gz
Stop showing task status if no tasks are present
Previously the task status would be visible even if there where no tasks in the description. This fixes that by changing the regex to check for tasks without 0. This also fixes a bug where update the description inline would not update the task status text on screen. Closes #33880
Diffstat (limited to 'spec/javascripts/issue_show/components/description_spec.js')
-rw-r--r--spec/javascripts/issue_show/components/description_spec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/issue_show/components/description_spec.js b/spec/javascripts/issue_show/components/description_spec.js
index 886462c4b9a..f3fdbff01a6 100644
--- a/spec/javascripts/issue_show/components/description_spec.js
+++ b/spec/javascripts/issue_show/components/description_spec.js
@@ -95,6 +95,18 @@ describe('Description component', () => {
done();
});
});
+
+ it('clears task status text when no tasks are present', (done) => {
+ vm.taskStatus = '0 of 0';
+
+ setTimeout(() => {
+ expect(
+ document.querySelector('.issuable-meta #task_status').textContent.trim(),
+ ).toBe('');
+
+ done();
+ });
+ });
});
it('applies syntax highlighting and math when description changed', (done) => {