Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-14 18:08:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-14 18:08:43 +0300
commit9b8269e5708ba1c38610189f84cf7224b640c0ed (patch)
tree70916a0afcfd90ed5425a80bab7f6bedca13d622 /spec/components/pajamas
parent7a124e225ea58c2a432dd29f82ba682963886383 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/components/pajamas')
-rw-r--r--spec/components/pajamas/alert_component_spec.rb48
1 files changed, 11 insertions, 37 deletions
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