Commit 66154286 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'rs-issue-988-test' into 'master'

Add test case for clicking line number anchor icon

Follow-up to !988

See merge request !992
parents 4998f7a0 dd6daf46
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
.file-content .file-content
.line-numbers .line-numbers
- 1.upto(25) do |i| - 1.upto(25) do |i|
%a{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i}= i %a{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i}
%i.fa.fa-link
= i
%pre.code.highlight %pre.code.highlight
%code %code
- 1.upto(25) do |i| - 1.upto(25) do |i|
......
...@@ -48,6 +48,14 @@ describe 'LineHighlighter', -> ...@@ -48,6 +48,14 @@ describe 'LineHighlighter', ->
clickLine(13) clickLine(13)
expect(spy).toHaveBeenPrevented() expect(spy).toHaveBeenPrevented()
it 'handles clicking on a child icon element', ->
spy = spyOn(@class, 'setHash').and.callThrough()
$('#L13 i').mousedown().click()
expect(spy).toHaveBeenCalledWith(13)
expect($('#LC13')).toHaveClass(@css)
describe 'without shiftKey', -> describe 'without shiftKey', ->
it 'highlights one line when clicked', -> it 'highlights one line when clicked', ->
clickLine(13) clickLine(13)
......
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