diff --git a/rubocop/cop/qa/element_with_pattern.rb b/rubocop/cop/qa/element_with_pattern.rb index 387ca3eb5175afa8bddb95a6a8ec37c627b20f5f..1f256e2f91d58b85e156934ef43be0d97b767bd5 100644 --- a/rubocop/cop/qa/element_with_pattern.rb +++ b/rubocop/cop/qa/element_with_pattern.rb @@ -30,7 +30,7 @@ def on_send(node) return if args.first.nil? args.first.each_node(:str) do |arg| - add_offense(arg, message: MESSAGE % "data-qa-selector=#{element_name.value}") + add_offense(arg, message: MESSAGE % "data-testid=#{element_name.value}") end end diff --git a/spec/rubocop/cop/qa/element_with_pattern_spec.rb b/spec/rubocop/cop/qa/element_with_pattern_spec.rb index ccc03d7f5ae83f3611db5023889503fde361e94c..7f816f3d8172196659fee69eb7c5f47d69d6ec1e 100644 --- a/spec/rubocop/cop/qa/element_with_pattern_spec.rb +++ b/spec/rubocop/cop/qa/element_with_pattern_spec.rb @@ -16,9 +16,9 @@ expect_offense(<<-RUBY) view 'app/views/shared/groups/_search_form.html.haml' do element :groups_filter, 'search_field_tag :filter' - ^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `data-qa-selector=groups_filter` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `data-testid=groups_filter` instead. element :groups_filter_placeholder, /Search by name/ - ^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `data-qa-selector=groups_filter_placeholder` instead. + ^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `data-testid=groups_filter_placeholder` instead. end RUBY end