Commit ea448039 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken tests

parent 57f52b9e
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
'getNotesData', 'getNotesData',
]), ]),
isLoggedIn() { isLoggedIn() {
return this.getUserData !== null; return this.getUserData.id;
}, },
commentButtonTitle() { commentButtonTitle() {
return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion'; return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion';
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
'saveNote', 'saveNote',
]), ]),
setIsSubmitButtonDisabled(note, isSubmitting) { setIsSubmitButtonDisabled(note, isSubmitting) {
if (!_.isEmpty(note) && !isSubmitting) { if (!_.isEmpty(note) && !isSubmitting) {
this.isSubmitButtonDisabled = false; this.isSubmitButtonDisabled = false;
} else { } else {
this.isSubmitButtonDisabled = true; this.isSubmitButtonDisabled = true;
......
...@@ -137,7 +137,7 @@ module SharedNote ...@@ -137,7 +137,7 @@ module SharedNote
step 'The comment with the header should not have an ID' do step 'The comment with the header should not have an ID' do
page.within(".note-body > .note-text") do page.within(".note-body > .note-text") do
expect(page).to have_content("Comment with a header") expect(page).to have_content("Comment with a header")
expect(page).not_to have_css("#comment-with-a-header") expect(page).not_to have_css("#comment-with-a-header")
end end
end end
...@@ -153,10 +153,13 @@ module SharedNote ...@@ -153,10 +153,13 @@ module SharedNote
note.find('.js-note-edit').click note.find('.js-note-edit').click
end end
page.find('.current-note-edit-form textarea')
page.within(".current-note-edit-form") do page.within(".current-note-edit-form") do
fill_in 'note[note]', with: '+1 Awesome!' fill_in '#note-body', with: '+1 Awesome!'
click_button 'Save comment' click_button 'Save comment'
end end
wait_for_requests
end end
step 'I should see +1 in the description' do step 'I should see +1 in the description' do
......
import Vue from 'vue';
import store from '~/notes/stores';
import issueDiscussion from '~/notes/components/issue_discussion.vue';
import { issueDataMock, discussionMock } from '../mock_data';
describe('issue_discussion component', () => { describe('issue_discussion component', () => {
let vm;
beforeEach(() => {
const Component = Vue.extend(issueDiscussion);
store.dispatch('setIssueData', issueDataMock);
vm = new Component({
store,
propsData: {
note: discussionMock,
},
}).$mount();
});
it('should render user avatar', () => { it('should render user avatar', () => {
console.log('vm', vm.$el);
}); });
......
...@@ -8,7 +8,7 @@ import ZenMode from '~/zen_mode'; ...@@ -8,7 +8,7 @@ import ZenMode from '~/zen_mode';
var enterZen, escapeKeydown, exitZen; var enterZen, escapeKeydown, exitZen;
describe('ZenMode', function() { describe('ZenMode', function() {
var fixtureName = 'issues/open-issue.html.raw'; var fixtureName = 'merge_requests/merge_request_with_comment.html.raw';
preloadFixtures(fixtureName); preloadFixtures(fixtureName);
beforeEach(function() { beforeEach(function() {
loadFixtures(fixtureName); loadFixtures(fixtureName);
......
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