diff options
Diffstat (limited to 'spec/javascripts/syntax_highlight_spec.js')
-rw-r--r-- | spec/javascripts/syntax_highlight_spec.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/spec/javascripts/syntax_highlight_spec.js b/spec/javascripts/syntax_highlight_spec.js index af3a5d58ba7..5438368ccbe 100644 --- a/spec/javascripts/syntax_highlight_spec.js +++ b/spec/javascripts/syntax_highlight_spec.js @@ -9,35 +9,44 @@ describe('Syntax Highlighter', function() { if (window.gon == null) { window.gon = {}; } - return window.gon.user_color_scheme = value; + return (window.gon.user_color_scheme = value); }; describe('on a js-syntax-highlight element', function() { beforeEach(function() { return setFixtures('<div class="js-syntax-highlight"></div>'); }); - return it('applies syntax highlighting', function() { + + it('applies syntax highlighting', function() { stubUserColorScheme('monokai'); syntaxHighlight($('.js-syntax-highlight')); - return expect($('.js-syntax-highlight')).toHaveClass('monokai'); + + expect($('.js-syntax-highlight')).toHaveClass('monokai'); }); }); - return describe('on a parent element', function() { + + describe('on a parent element', function() { beforeEach(function() { - return setFixtures("<div class=\"parent\">\n <div class=\"js-syntax-highlight\"></div>\n <div class=\"foo\"></div>\n <div class=\"js-syntax-highlight\"></div>\n</div>"); + return setFixtures( + '<div class="parent">\n <div class="js-syntax-highlight"></div>\n <div class="foo"></div>\n <div class="js-syntax-highlight"></div>\n</div>', + ); }); + it('applies highlighting to all applicable children', function() { stubUserColorScheme('monokai'); syntaxHighlight($('.parent')); + expect($('.parent, .foo')).not.toHaveClass('monokai'); - return expect($('.monokai').length).toBe(2); + expect($('.monokai').length).toBe(2); }); - return it('prevents an infinite loop when no matches exist', function() { + + it('prevents an infinite loop when no matches exist', function() { var highlight; setFixtures('<div></div>'); highlight = function() { return syntaxHighlight($('div')); }; - return expect(highlight).not.toThrow(); + + expect(highlight).not.toThrow(); }); }); }); |