summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-19 16:30:42 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-05-19 16:30:42 +0000
commitc19d58de67ecf0fcf224ad72d1756e2e9b8fe83c (patch)
tree6ae169bf8d25a7e091260a40045d32beec9931dc /spec
parent6ad2a9c2e996bab4001f97a79e9ec3c7ce09be3f (diff)
parent682cfbb4dc328a8ffa597ddbb337673ed5dc844f (diff)
downloadgitlab-ce-c19d58de67ecf0fcf224ad72d1756e2e9b8fe83c.tar.gz
Merge branch '32551-fix-system-note-comparison-and-standardize-note-setup' into 'master'
Fix system note comparison and standardize note setup Closes #32551 See merge request !11532
Diffstat (limited to 'spec')
-rw-r--r--spec/features/issues/note_polling_spec.rb24
-rw-r--r--spec/javascripts/notes_spec.js1
2 files changed, 21 insertions, 4 deletions
diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb
index da81fa4e367..80f57906506 100644
--- a/spec/features/issues/note_polling_spec.rb
+++ b/spec/features/issues/note_polling_spec.rb
@@ -31,12 +31,12 @@ feature 'Issue notes polling', :feature, :js do
it 'has .original-note-content to compare against' do
expect(page).to have_selector("#note_#{existing_note.id}", text: note_text)
- expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", visible: false)
+ expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", count: 1, visible: false)
update_note(existing_note, updated_text)
expect(page).to have_selector("#note_#{existing_note.id}", text: updated_text)
- expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", visible: false)
+ expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", count: 1, visible: false)
end
it 'displays the updated content' do
@@ -98,12 +98,28 @@ feature 'Issue notes polling', :feature, :js do
it 'has .original-note-content to compare against' do
expect(page).to have_selector("#note_#{existing_note.id}", text: note_text)
- expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", visible: false)
+ expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", count: 1, visible: false)
update_note(existing_note, updated_text)
expect(page).to have_selector("#note_#{existing_note.id}", text: updated_text)
- expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", visible: false)
+ expect(page).to have_selector("#note_#{existing_note.id} .original-note-content", count: 1, visible: false)
+ end
+ end
+
+ context 'system notes' do
+ let(:user) { create(:user) }
+ let(:note_text) { "Some system note" }
+ let!(:system_note) { create(:system_note, noteable: issue, project: project, author: user, note: note_text) }
+
+ before do
+ login_as(user)
+ visit namespace_project_issue_path(project.namespace, project, issue)
+ end
+
+ it 'has .original-note-content to compare against' do
+ expect(page).to have_selector("#note_#{system_note.id}", text: note_text)
+ expect(page).to have_selector("#note_#{system_note.id} .original-note-content", count: 1, visible: false)
end
end
end
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js
index d3494aaa94f..025f08ee332 100644
--- a/spec/javascripts/notes_spec.js
+++ b/spec/javascripts/notes_spec.js
@@ -139,6 +139,7 @@ import '~/notes';
]);
notes = jasmine.createSpyObj('notes', [
+ 'setupNewNote',
'refresh',
'collapseLongCommitList',
'updateNotesCount',