提交 dd6daf46 编写于 作者: R Robert Speicher

Add test case for clicking line number anchor icon

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册