Commit b96a3d4d authored by Filipa Lacerda's avatar Filipa Lacerda

Fix open discussions

Put back deleted tests
parent b38e6903
<script> <script>
/* global Flash, Autosave */ /* global Flash */
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { SYSTEM_NOTE } from '../constants'; import { SYSTEM_NOTE } from '../constants';
import issueNote from './issue_note.vue'; import issueNote from './issue_note.vue';
......
...@@ -140,11 +140,25 @@ ...@@ -140,11 +140,25 @@
return title; return title;
}, },
handleAward(awardName) { handleAward(awardName) {
let parsedName;
// 100 and 1234 emoji are a number. Callback for v-for click sends it as a string
switch(awardName) {
case '100':
parsedName = 100;
break;
case '1234':
parsedName = 1234;
break;
default:
parsedName = awardName;
break;
}
const data = { const data = {
endpoint: this.toggleAwardPath, endpoint: this.toggleAwardPath,
noteId: this.noteId, noteId: this.noteId,
// 100 emoji is a number. Callback for v-for click sends it as a string awardName: parsedName,
awardName: awardName === '100' ? 100 : awardName,
}; };
this.toggleAwardRequest(data) this.toggleAwardRequest(data)
......
...@@ -129,7 +129,6 @@ ...@@ -129,7 +129,6 @@
:quick-actions-docs="quickActionsDocsUrl" :quick-actions-docs="quickActionsDocsUrl"
:add-spacing-classes="false"> :add-spacing-classes="false">
<textarea <textarea
id="note-body"
name="note[note]" name="note[note]"
class="note-textarea js-gfm-input js-autosize markdown-area js-vue-issue-note-form" class="note-textarea js-gfm-input js-autosize markdown-area js-vue-issue-note-form"
:data-supports-quick-actions="!isEditing" :data-supports-quick-actions="!isEditing"
......
...@@ -86,7 +86,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => { ...@@ -86,7 +86,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
const { errors } = res; const { errors } = res;
const commandsChanges = res.commands_changes; const commandsChanges = res.commands_changes;
if (hasQuickActions && Object.keys(errors).length) { if (hasQuickActions && errors && Object.keys(errors).length) {
dispatch('fetchData'); dispatch('fetchData');
$('.js-gfm-input').trigger('clear-commands-cache.atwho'); $('.js-gfm-input').trigger('clear-commands-cache.atwho');
......
...@@ -156,7 +156,7 @@ module SharedNote ...@@ -156,7 +156,7 @@ module SharedNote
page.find('.current-note-edit-form textarea') page.find('.current-note-edit-form textarea')
page.within(".current-note-edit-form") do page.within(".current-note-edit-form") do
fill_in '#note-body', with: '+1 Awesome!' fill_in 'note[note]', with: '+1 Awesome!'
click_button 'Save comment' click_button 'Save comment'
end end
wait_for_requests wait_for_requests
......
...@@ -67,7 +67,7 @@ feature 'Merge Requests > User uses quick actions', js: true do ...@@ -67,7 +67,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
it 'does not change the WIP prefix' do it 'does not change the WIP prefix' do
write_note("/wip") write_note("/wip")
expect(page).to have_content '/wip' expect(page).not_to have_content '/wip'
expect(page).not_to have_content 'Commands applied' expect(page).not_to have_content 'Commands applied'
expect(merge_request.reload.work_in_progress?).to eq false expect(merge_request.reload.work_in_progress?).to eq false
...@@ -78,7 +78,7 @@ feature 'Merge Requests > User uses quick actions', js: true do ...@@ -78,7 +78,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
describe 'merging the MR from the note' do describe 'merging the MR from the note' do
context 'when the current user can merge the MR' do context 'when the current user can merge the MR' do
it 'merges the MR' do it 'merges the MR' do
write_note("/merge", false) write_note("/merge")
expect(page).to have_content 'Commands applied' expect(page).to have_content 'Commands applied'
...@@ -197,7 +197,7 @@ feature 'Merge Requests > User uses quick actions', js: true do ...@@ -197,7 +197,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
it 'does not change target branch' do it 'does not change target branch' do
write_note('/target_branch merge-test') write_note('/target_branch merge-test')
expect(page).to have_content '/target_branch merge-test' expect(page).not_to have_content '/target_branch merge-test'
expect(merge_request.target_branch).to eq 'feature' expect(merge_request.target_branch).to eq 'feature'
end end
......
...@@ -15,7 +15,7 @@ feature 'Member autocomplete', :js do ...@@ -15,7 +15,7 @@ feature 'Member autocomplete', :js do
before do before do
page.within('.new-note') do page.within('.new-note') do
if note.noteable_type === 'Issue' if note.noteable_type === 'Issue'
find('#note-body').send_keys('@') find('.js-vue-comment-form').send_keys('@')
else else
find('#note_note').send_keys('@') find('#note_note').send_keys('@')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment