Commit b96a3d4d authored by Filipa Lacerda's avatar Filipa Lacerda

Fix open discussions

Put back deleted tests
parent b38e6903
<script>
/* global Flash, Autosave */
/* global Flash */
import { mapActions, mapGetters } from 'vuex';
import { SYSTEM_NOTE } from '../constants';
import issueNote from './issue_note.vue';
......
......@@ -140,11 +140,25 @@
return title;
},
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 = {
endpoint: this.toggleAwardPath,
noteId: this.noteId,
// 100 emoji is a number. Callback for v-for click sends it as a string
awardName: awardName === '100' ? 100 : awardName,
awardName: parsedName,
};
this.toggleAwardRequest(data)
......
......@@ -129,7 +129,6 @@
:quick-actions-docs="quickActionsDocsUrl"
:add-spacing-classes="false">
<textarea
id="note-body"
name="note[note]"
class="note-textarea js-gfm-input js-autosize markdown-area js-vue-issue-note-form"
:data-supports-quick-actions="!isEditing"
......
......@@ -86,7 +86,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
const { errors } = res;
const commandsChanges = res.commands_changes;
if (hasQuickActions && Object.keys(errors).length) {
if (hasQuickActions && errors && Object.keys(errors).length) {
dispatch('fetchData');
$('.js-gfm-input').trigger('clear-commands-cache.atwho');
......
......@@ -17,4 +17,4 @@
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'notes'
= render "layouts/init_auto_complete"
\ No newline at end of file
= render "layouts/init_auto_complete"
......@@ -156,7 +156,7 @@ module SharedNote
page.find('.current-note-edit-form textarea')
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'
end
wait_for_requests
......
......@@ -67,7 +67,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
it 'does not change the WIP prefix' do
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(merge_request.reload.work_in_progress?).to eq false
......@@ -78,7 +78,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
describe 'merging the MR from the note' do
context 'when the current user can merge the MR' do
it 'merges the MR' do
write_note("/merge", false)
write_note("/merge")
expect(page).to have_content 'Commands applied'
......@@ -197,7 +197,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
it 'does not change target branch' do
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'
end
......
......@@ -15,7 +15,7 @@ feature 'Member autocomplete', :js do
before do
page.within('.new-note') do
if note.noteable_type === 'Issue'
find('#note-body').send_keys('@')
find('.js-vue-comment-form').send_keys('@')
else
find('#note_note').send_keys('@')
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