Commit dd6daf46 authored by Robert Speicher's avatar Robert Speicher

Add test case for clicking line number anchor icon

parent 4998f7a0
......@@ -2,7 +2,9 @@
.file-content
.line-numbers
- 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
%code
- 1.upto(25) do |i|
......
......@@ -48,6 +48,14 @@ describe 'LineHighlighter', ->
clickLine(13)
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', ->
it 'highlights one line when clicked', ->
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