Skip to content

Commit

Permalink
Adapt bs_request_activity_timeline_component_spec
Browse files Browse the repository at this point in the history
We now passing the history elements to the initializer over
fetching them inside the view component.
  • Loading branch information
krauselukas committed Mar 28, 2024
1 parent a491b9f commit e99a897
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -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

0 comments on commit e99a897

Please sign in to comment.