Commit 3281e6db authored by ddavison's avatar ddavison

Treat element#selector_css string appropriately

Proper escaping should be used for page/base.rb#scroll_to
as it is a single quoted JS string
parent 015b61b1
......@@ -28,7 +28,7 @@ module QA
end
def selector_css
"[data-qa-selector='#{@name}'],.#{selector}"
%Q([data-qa-selector="#{@name}"],.#{selector})
end
def expression
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment