Skip to content

Commit

Permalink
Merge pull request #17211 from opf/bug/58738-work-package-creation-ev…
Browse files Browse the repository at this point in the history
…ent-not-displayed-if-aggregation-includes-a-comment

Bug/58738 work package creation event not displayed if aggregation includes a comment
  • Loading branch information
jjabari-op authored Nov 19, 2024
2 parents ad7a414 + 9662d71 commit 2556277
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis hidden-for-mobile") do
truncated_user_name(journal.user)
end
if journal.initial?
header_start_container.with_column(
mr: 1,
classes: "work-packages-activities-tab-journals-item-component-details--journal-type hidden-for-mobile"
) do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) do
I18n.t("activities.work_packages.activity_tab.created_on")
end
end
end
header_start_container.with_column(mr: 1, classes: "hidden-for-mobile") do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) { format_time(journal.updated_at) }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/activities/work_package/activities_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
version: 2)

# the comment is shown without browser reload
wait_for { page }.to have_test_selector("op-journal-notes-body", text: "First comment by member")
activity_tab.expect_journal_notes(text: "First comment by member")

# simulate comments made within the polling interval
create(:work_package_journal, user: member, notes: "Second comment by member", journable: work_package, version: 3)
Expand All @@ -393,7 +393,7 @@
first_journal.update!(notes: "First comment by member updated")

# properly updates the comment when the comment is updated
wait(delay: 0.5).for { page }.to have_test_selector("op-journal-notes-body", text: "First comment by member updated")
activity_tab.expect_journal_notes(text: "First comment by member updated")
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/support/components/work_packages/activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def expect_no_journal_notes_header(text: nil)
end

def expect_journal_notes(text: nil)
expect(page).to have_test_selector("op-journal-notes-body", text:)
expect(page).to have_test_selector("op-journal-notes-body", text:, wait: 10)
end

def expect_notification_bubble
Expand Down

0 comments on commit 2556277

Please sign in to comment.