From f38bcf2e443dd89acc774a2fa1efa2e881a67a90 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 6 May 2022 00:07:56 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/components/pajamas/alert_component_spec.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'spec/components/pajamas') diff --git a/spec/components/pajamas/alert_component_spec.rb b/spec/components/pajamas/alert_component_spec.rb index 58c1cb2231a..e596f07a15a 100644 --- a/spec/components/pajamas/alert_component_spec.rb +++ b/spec/components/pajamas/alert_component_spec.rb @@ -2,13 +2,23 @@ require "spec_helper" RSpec.describe Pajamas::AlertComponent, :aggregate_failures, type: :component do - context 'with content' do + context 'slots' do + let_it_be(:body) { 'Alert body' } + let_it_be(:actions) { 'Alert actions' } + before do - render_inline(described_class.new) { '_content_' } + render_inline described_class.new do |c| + c.body { body } + c.actions { actions } + end + end + + it 'renders alert body' do + expect(rendered_component).to have_content(body) end - it 'has content' do - expect(rendered_component).to have_text('_content_') + it 'renders actions' do + expect(rendered_component).to have_content(actions) end end -- cgit v1.2.3