From 3022300c02058b1fe06f359b814023cfb91044fc Mon Sep 17 00:00:00 2001 From: Lukas Krause Date: Thu, 28 Mar 2024 11:32:13 +0100 Subject: [PATCH] Adapt `bs_request_activity_timeline_component_spec` We now passing the history elements to the initializer over fetching them inside the view component. --- .../bs_request_activity_timeline_component_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/spec/components/bs_request_activity_timeline_component_spec.rb b/src/api/spec/components/bs_request_activity_timeline_component_spec.rb index 77fb7a7c72b1..172bdf7ab2c3 100644 --- a/src/api/spec/components/bs_request_activity_timeline_component_spec.rb +++ b/src/api/spec/components/bs_request_activity_timeline_component_spec.rb @@ -4,11 +4,11 @@ let!(:comment) { travel_to(1.day.ago) { create(:comment_request, commentable: bs_request) } } it 'shows the comment first, as it is an older timeline item' do - expect(render_inline(described_class.new(bs_request: bs_request))).to have_css('.timeline-item:first-child', text: comment.user.login) - expect(render_inline(described_class.new(bs_request: bs_request))).to have_css('.timeline-item:first-child', text: '1 day ago') + expect(render_inline(described_class.new(bs_request: bs_request, history_elements: [history_element]))).to have_css('.timeline-item:first-child', text: comment.user.login) + expect(render_inline(described_class.new(bs_request: bs_request, history_elements: [history_element]))).to have_css('.timeline-item:first-child', text: '1 day ago') end it 'shows the history element in the second position, as it is more recent' do - expect(render_inline(described_class.new(bs_request: bs_request))).to have_css('.timeline-item:last-child', text: 'accepted request') + expect(render_inline(described_class.new(bs_request: bs_request, history_elements: [history_element]))).to have_css('.timeline-item:last-child', text: 'accepted request') end end