diff options
author | ddavison <ddavison@gitlab.com> | 2019-07-10 16:20:31 -0700 |
---|---|---|
committer | ddavison <ddavison@gitlab.com> | 2019-07-10 16:20:31 -0700 |
commit | 3281e6db23d8f1ea6757af6eb71e87ed7a93c130 (patch) | |
tree | 2ea1d8c45c904dc2b453c8984a8b70ecacfb3e62 /qa | |
parent | 015b61b1dc73e2c8d6e6cf04b6b2c7fb896a452f (diff) | |
download | gitlab-ce-3281e6db23d8f1ea6757af6eb71e87ed7a93c130.tar.gz |
Treat element#selector_css string appropriatelyqa-dd-data-qa-selector-replacement
Proper escaping should be used for page/base.rb#scroll_to
as it is a single quoted JS string
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/element.rb | 2 | ||||
-rw-r--r-- | qa/spec/page/element_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/qa/qa/page/element.rb b/qa/qa/page/element.rb index f9aa9cc6377..9e6fd2fdd4f 100644 --- a/qa/qa/page/element.rb +++ b/qa/qa/page/element.rb @@ -28,7 +28,7 @@ module QA end def selector_css - "[data-qa-selector='#{@name}'],.#{selector}" + %Q([data-qa-selector="#{@name}"],.#{selector}) end def expression diff --git a/qa/spec/page/element_spec.rb b/qa/spec/page/element_spec.rb index 87c9fbf74a3..20d4a00c020 100644 --- a/qa/spec/page/element_spec.rb +++ b/qa/spec/page/element_spec.rb @@ -114,7 +114,7 @@ describe QA::Page::Element do describe 'data-qa selectors' do subject { described_class.new(:my_element) } it 'properly translates to a data-qa-selector' do - expect(subject.selector_css).to include("[data-qa-selector='my_element']") + expect(subject.selector_css).to include(%q([data-qa-selector="my_element"])) end end end |