From 9b8269e5708ba1c38610189f84cf7224b640c0ed Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 14 Jun 2022 15:08:43 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/components/pajamas/alert_component_spec.rb | 48 ++++++------------------- 1 file changed, 11 insertions(+), 37 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 db425fb2dce..1e2845c44a8 100644 --- a/spec/components/pajamas/alert_component_spec.rb +++ b/spec/components/pajamas/alert_component_spec.rb @@ -50,10 +50,12 @@ RSpec.describe Pajamas::AlertComponent, :aggregate_failures, type: :component do before do render_inline described_class.new( title: '_title_', - alert_class: '_alert_class_', - alert_data: { - feature_id: '_feature_id_', - dismiss_endpoint: '_dismiss_endpoint_' + alert_options: { + class: '_alert_class_', + data: { + feature_id: '_feature_id_', + dismiss_endpoint: '_dismiss_endpoint_' + } } ) end @@ -106,9 +108,11 @@ RSpec.describe Pajamas::AlertComponent, :aggregate_failures, type: :component do context 'with dismissible content' do before do render_inline described_class.new( - close_button_class: '_close_button_class_', - close_button_data: { - testid: '_close_button_testid_' + close_button_options: { + class: '_close_button_class_', + data: { + testid: '_close_button_testid_' + } } ) end @@ -138,35 +142,5 @@ RSpec.describe Pajamas::AlertComponent, :aggregate_failures, type: :component do end end end - - context 'with alert_options' do - let(:options) { { alert_options: { id: 'test_id', class: 'baz', data: { foo: 'bar' } } } } - - before do - render_inline described_class.new(**options) - end - - it 'renders the extra options' do - expect(rendered_component).to have_css "#test_id.gl-alert.baz[data-foo='bar']" - end - - context 'with custom classes or data' do - let(:options) do - { - variant: :danger, - alert_class: 'custom', - alert_data: { foo: 'bar' }, - alert_options: { - class: 'extra special', - data: { foo: 'conflict' } - } - } - end - - it 'doesn\'t conflict with internal alert_class or alert_data' do - expect(rendered_component).to have_css ".extra.special.custom.gl-alert.gl-alert-danger[data-foo='bar']" - end - end - end end end -- cgit v1.2.3