diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 21:13:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 21:13:15 +0300 |
commit | 3a563d7c1e15023f205d2a357e5d8a38a3b53ecc (patch) | |
tree | b7979f23104af9ed6d0ef077ce9964ba5d7ad65e /spec/components | |
parent | dcc56fe601580b5d8f6c3da32550c6523f2baff3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/components')
8 files changed, 41 insertions, 41 deletions
diff --git a/spec/components/layouts/horizontal_section_component_spec.rb b/spec/components/layouts/horizontal_section_component_spec.rb index efc48213911..b0a749e58d6 100644 --- a/spec/components/layouts/horizontal_section_component_spec.rb +++ b/spec/components/layouts/horizontal_section_component_spec.rb @@ -9,8 +9,8 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do describe 'slots' do it 'renders title' do render_inline described_class.new do |c| - c.title { title } - c.body { body } + c.with_title { title } + c.with_body { body } end expect(page).to have_css('h4', text: title) @@ -18,8 +18,8 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do it 'renders body slot' do render_inline described_class.new do |c| - c.title { title } - c.body { body } + c.with_title { title } + c.with_body { body } end expect(page).to have_content(body) @@ -28,9 +28,9 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do context 'when description slot is provided' do before do render_inline described_class.new do |c| - c.title { title } - c.description { description } - c.body { body } + c.with_title { title } + c.with_description { description } + c.with_body { body } end end @@ -42,8 +42,8 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do context 'when description slot is not provided' do before do render_inline described_class.new do |c| - c.title { title } - c.body { body } + c.with_title { title } + c.with_body { body } end end @@ -57,8 +57,8 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do describe 'border' do it 'defaults to true and adds gl-border-b CSS class' do render_inline described_class.new do |c| - c.title { title } - c.body { body } + c.with_title { title } + c.with_body { body } end expect(page).to have_css('.gl-border-b') @@ -66,8 +66,8 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do it 'does not add gl-border-b CSS class when set to false' do render_inline described_class.new(border: false) do |c| - c.title { title } - c.body { body } + c.with_title { title } + c.with_body { body } end expect(page).not_to have_css('.gl-border-b') @@ -77,8 +77,8 @@ RSpec.describe Layouts::HorizontalSectionComponent, type: :component do describe 'options' do it 'adds options to wrapping element' do render_inline described_class.new(options: { data: { testid: 'foo-bar' }, class: 'foo-bar' }) do |c| - c.title { title } - c.body { body } + c.with_title { title } + c.with_body { body } end expect(page).to have_css('.foo-bar[data-testid="foo-bar"]') diff --git a/spec/components/pajamas/alert_component_spec.rb b/spec/components/pajamas/alert_component_spec.rb index 4a90a9e0b88..8f02979357e 100644 --- a/spec/components/pajamas/alert_component_spec.rb +++ b/spec/components/pajamas/alert_component_spec.rb @@ -8,8 +8,8 @@ RSpec.describe Pajamas::AlertComponent, :aggregate_failures, type: :component do before do render_inline described_class.new do |c| - c.body { body } - c.actions { actions } + c.with_body { body } + c.with_actions { actions } end end diff --git a/spec/components/pajamas/avatar_component_spec.rb b/spec/components/pajamas/avatar_component_spec.rb index 3b4e4e49fc2..d59ef390fad 100644 --- a/spec/components/pajamas/avatar_component_spec.rb +++ b/spec/components/pajamas/avatar_component_spec.rb @@ -92,7 +92,7 @@ RSpec.describe Pajamas::AvatarComponent, type: :component do let(:record) { user } it "uses a gravatar" do - expect(rendered_component).to match /gravatar\.com/ + expect(rendered_content).to match /gravatar\.com/ end end end diff --git a/spec/components/pajamas/banner_component_spec.rb b/spec/components/pajamas/banner_component_spec.rb index 861b10c3f69..6b99b4c1d76 100644 --- a/spec/components/pajamas/banner_component_spec.rb +++ b/spec/components/pajamas/banner_component_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do describe 'basic usage' do before do render_inline(subject) do |c| - c.title { title } + c.with_title { title } content end end @@ -124,8 +124,8 @@ RSpec.describe Pajamas::BannerComponent, type: :component do context 'with illustration slot' do before do render_inline(subject) do |c| - c.title { title } - c.illustration { "<svg></svg>".html_safe } + c.with_title { title } + c.with_illustration { "<svg></svg>".html_safe } content end end @@ -147,8 +147,8 @@ RSpec.describe Pajamas::BannerComponent, type: :component do context 'with primary_action slot' do before do render_inline(subject) do |c| - c.title { title } - c.primary_action { "<a class='special' href='#'>Special</a>".html_safe } + c.with_title { title } + c.with_primary_action { "<a class='special' href='#'>Special</a>".html_safe } content end end diff --git a/spec/components/pajamas/card_component_spec.rb b/spec/components/pajamas/card_component_spec.rb index 38d23cfca9c..6328385754d 100644 --- a/spec/components/pajamas/card_component_spec.rb +++ b/spec/components/pajamas/card_component_spec.rb @@ -9,9 +9,9 @@ RSpec.describe Pajamas::CardComponent, :aggregate_failures, type: :component do context 'slots' do before do render_inline described_class.new do |c| - c.header { header } - c.body { body } - c.footer { footer } + c.with_header { header } + c.with_body { body } + c.with_footer { footer } end end @@ -51,9 +51,9 @@ RSpec.describe Pajamas::CardComponent, :aggregate_failures, type: :component do header_options: { class: '_header_class_', data: { testid: '_header_testid_' } }, body_options: { class: '_body_class_', data: { testid: '_body_testid_' } }, footer_options: { class: '_footer_class_', data: { testid: '_footer_testid_' } }) do |c| - c.header { header } - c.body { body } - c.footer { footer } + c.with_header { header } + c.with_body { body } + c.with_footer { footer } end end diff --git a/spec/components/pajamas/checkbox_component_spec.rb b/spec/components/pajamas/checkbox_component_spec.rb index 3d50509ef10..ea3ebe77811 100644 --- a/spec/components/pajamas/checkbox_component_spec.rb +++ b/spec/components/pajamas/checkbox_component_spec.rb @@ -76,7 +76,7 @@ RSpec.describe Pajamas::CheckboxComponent, :aggregate_failures, type: :component method: method ) ) do |c| - c.label { label } + c.with_label { label } end end end @@ -94,7 +94,7 @@ RSpec.describe Pajamas::CheckboxComponent, :aggregate_failures, type: :component label: label ) ) do |c| - c.help_text { help_text } + c.with_help_text { help_text } end end end @@ -112,8 +112,8 @@ RSpec.describe Pajamas::CheckboxComponent, :aggregate_failures, type: :component method: method ) ) do |c| - c.label { label } - c.help_text { help_text } + c.with_label { label } + c.with_help_text { help_text } end end end diff --git a/spec/components/pajamas/checkbox_tag_component_spec.rb b/spec/components/pajamas/checkbox_tag_component_spec.rb index bca7a6005d5..fb5f927469b 100644 --- a/spec/components/pajamas/checkbox_tag_component_spec.rb +++ b/spec/components/pajamas/checkbox_tag_component_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Pajamas::CheckboxTagComponent, :aggregate_failures, type: :compon context 'with default options' do before do render_inline(described_class.new(name: name)) do |c| - c.label { label } + c.with_label { label } end end @@ -32,7 +32,7 @@ RSpec.describe Pajamas::CheckboxTagComponent, :aggregate_failures, type: :compon label_options: label_options ) ) do |c| - c.label { label } + c.with_label { label } end end @@ -48,8 +48,8 @@ RSpec.describe Pajamas::CheckboxTagComponent, :aggregate_failures, type: :compon context 'with `help_text` slot' do before do render_inline(described_class.new(name: name)) do |c| - c.label { label } - c.help_text { help_text } + c.with_label { label } + c.with_help_text { help_text } end end diff --git a/spec/components/pajamas/radio_component_spec.rb b/spec/components/pajamas/radio_component_spec.rb index 8df432746d0..5b12e7c2785 100644 --- a/spec/components/pajamas/radio_component_spec.rb +++ b/spec/components/pajamas/radio_component_spec.rb @@ -76,7 +76,7 @@ RSpec.describe Pajamas::RadioComponent, :aggregate_failures, type: :component do value: value ) ) do |c| - c.label { label } + c.with_label { label } end end end @@ -95,7 +95,7 @@ RSpec.describe Pajamas::RadioComponent, :aggregate_failures, type: :component do label: label ) ) do |c| - c.help_text { help_text } + c.with_help_text { help_text } end end end @@ -114,8 +114,8 @@ RSpec.describe Pajamas::RadioComponent, :aggregate_failures, type: :component do value: value ) ) do |c| - c.label { label } - c.help_text { help_text } + c.with_label { label } + c.with_help_text { help_text } end end end |