Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-07-16 00:08:46 +00:00
parent 040d734373
commit c827870863
4 changed files with 11 additions and 20 deletions

View file

@ -1 +1 @@
2ba30c8b1b5a428a645faf72881771af9a505ab2
76dabc8174f7978025f48adcfab0a19c85416531

View file

@ -15,18 +15,14 @@ module SystemNotes
def add_timeline_event(timeline_event)
author = timeline_event.author
anchor = "timeline_event_#{timeline_event.id}"
path = url_helpers.project_issues_incident_path(project, noteable, anchor: anchor)
body = "added an [incident timeline event](#{path})"
body = 'added an incident timeline event'
create_note(NoteSummary.new(noteable, project, author, body, action: 'timeline_event'))
end
def edit_timeline_event(timeline_event, author, was_changed:)
anchor = "timeline_event_#{timeline_event.id}"
path = url_helpers.project_issues_incident_path(project, noteable, anchor: anchor)
changed_text = CHANGED_TEXT.fetch(was_changed, '')
body = "edited #{changed_text}[incident timeline event](#{path})"
body = "edited #{changed_text}incident timeline event"
create_note(NoteSummary.new(noteable, project, author, body, action: 'timeline_event'))
end

View file

@ -24,10 +24,9 @@ printf "\nStarting GLFM snapshot example tests. See https://docs.gitlab.com/ee/d
printf "Set 'FOCUSED_MARKDOWN_EXAMPLES=example_name_1[,...]' for focused examples, with example name(s) from https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_specificationexample_snapshotsexamples_indexyml.\n"
printf "${Color_Off}"
# This section can be uncommented as soon as this is merged: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89953
#printf "\n${BBlue}Running frontend 'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js'...${Color_Off}\n\n"
#yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js
#printf "\n${BBlue}'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js' passed!${Color_Off}\n\n"
printf "\n${BBlue}Running frontend 'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js'...${Color_Off}\n\n"
yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js
printf "\n${BBlue}'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js' passed!${Color_Off}\n\n"
printf "\n${BBlue}Running backend 'bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb'...${Color_Off}\n\n"
bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb

View file

@ -3,8 +3,6 @@
require 'spec_helper'
RSpec.describe SystemNotes::IncidentsService do
include Gitlab::Routing
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:author) { create(:user) }
@ -22,14 +20,12 @@ RSpec.describe SystemNotes::IncidentsService do
end
it 'posts the correct text to the system note' do
path = project_issues_incident_path(project, incident, anchor: "timeline_event_#{timeline_event.id}")
expect(subject.note).to match("added an [incident timeline event](#{path})")
expect(subject.note).to match("added an incident timeline event")
end
end
describe '#edit_timeline_event' do
let(:was_changed) { :unknown }
let(:path) { project_issues_incident_path(project, incident, anchor: "timeline_event_#{timeline_event.id}") }
subject do
described_class.new(noteable: incident).edit_timeline_event(timeline_event, author, was_changed: was_changed)
@ -44,7 +40,7 @@ RSpec.describe SystemNotes::IncidentsService do
let(:was_changed) { :occurred_at }
it 'posts the correct text to the system note' do
expect(subject.note).to match("edited the event time/date on [incident timeline event](#{path})")
expect(subject.note).to match("edited the event time/date on incident timeline event")
end
end
@ -52,7 +48,7 @@ RSpec.describe SystemNotes::IncidentsService do
let(:was_changed) { :note }
it 'posts the correct text to the system note' do
expect(subject.note).to match("edited the text on [incident timeline event](#{path})")
expect(subject.note).to match("edited the text on incident timeline event")
end
end
@ -60,7 +56,7 @@ RSpec.describe SystemNotes::IncidentsService do
let(:was_changed) { :occurred_at_and_note }
it 'posts the correct text to the system note' do
expect(subject.note).to match("edited the event time/date and text on [incident timeline event](#{path})")
expect(subject.note).to match("edited the event time/date and text on incident timeline event")
end
end
@ -68,7 +64,7 @@ RSpec.describe SystemNotes::IncidentsService do
let(:was_changed) { :unknown }
it 'posts the correct text to the system note' do
expect(subject.note).to match("edited [incident timeline event](#{path})")
expect(subject.note).to match("edited incident timeline event")
end
end
end