summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes/components
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-09-21 03:08:17 +0300
committerFatih Acet <acetfatih@gmail.com>2017-09-21 03:08:17 +0300
commitd9a3bbce61fc76aee6fb5cbc65e46e11af2affd0 (patch)
tree68cf676d8992d0ba08ea9e0c1f445e7ea7412521 /spec/javascripts/notes/components
parentd15109dc5e6185b512785611cd3d146010e1eacc (diff)
downloadgitlab-ce-d9a3bbce61fc76aee6fb5cbc65e46e11af2affd0.tar.gz
IssueNotes: Resize comment form after note submit and discard.acet-fix-comment-form-resize
Diffstat (limited to 'spec/javascripts/notes/components')
-rw-r--r--spec/javascripts/notes/components/issue_comment_form_spec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/javascripts/notes/components/issue_comment_form_spec.js b/spec/javascripts/notes/components/issue_comment_form_spec.js
index cca5ec887a3..1c8b1b98242 100644
--- a/spec/javascripts/notes/components/issue_comment_form_spec.js
+++ b/spec/javascripts/notes/components/issue_comment_form_spec.js
@@ -1,4 +1,5 @@
import Vue from 'vue';
+import autosize from 'vendor/autosize';
import store from '~/notes/stores';
import issueCommentForm from '~/notes/components/issue_comment_form.vue';
import { loggedOutIssueData, notesDataMock, userDataMock, issueDataMock } from '../mock_data';
@@ -55,6 +56,19 @@ describe('issue_comment_form component', () => {
expect(vm.$el.querySelector(`a[href="${quickActionsDocsPath}"]`).textContent.trim()).toEqual('quick actions');
});
+ it('should resize textarea after note discarded', (done) => {
+ spyOn(autosize, 'update');
+ spyOn(vm, 'discard').and.callThrough();
+
+ vm.note = 'foo';
+ vm.discard();
+
+ Vue.nextTick(() => {
+ expect(autosize.update).toHaveBeenCalled();
+ done();
+ });
+ });
+
describe('edit mode', () => {
it('should enter edit mode when arrow up is pressed', () => {
spyOn(vm, 'editCurrentUserLastNote').and.callThrough();