From dc55d42491bbc80953862475f8fe1d929c835a1e Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Sun, 17 Aug 2014 11:31:24 +0200 Subject: [PATCH] :white_check_mark: Add test to verify implementation --- spec/editor-view-spec.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/editor-view-spec.coffee b/spec/editor-view-spec.coffee index 467266023..2a3dfd186 100644 --- a/spec/editor-view-spec.coffee +++ b/spec/editor-view-spec.coffee @@ -3045,3 +3045,12 @@ describe "EditorView", -> editorView.pixelPositionForScreenPosition([0, editor.getTabLength()]) editorView.pixelPositionForScreenPosition([0, editor.getTabLength() + 1]) expect(editorView.measureToColumn.callCount).toBe 0 + + describe "grammar data attributes", -> + it "adds and updates the grammar data attribute based on the current grammar", -> + editorView.attachToDom() + editor.setGrammar(atom.syntax.grammarForScopeName('text.plain')) + expect(editorView.attr('data-grammar')).toEqual 'text.plain' + + editor.setGrammar(atom.syntax.grammarForScopeName('source.javascript')) + expect(editorView.attr('data-grammar')).toEqual 'source.javascript'