diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index e93afa445..8005ab5f2 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -2164,6 +2164,12 @@ describe "EditorComponent", -> setEditorWidthInChars(wrapperView, 10) expect(componentNode.querySelector('.scroll-view').offsetWidth).toBe charWidth * 10 + describe "grammar data attributes", -> + it "adds and updates the grammar data attribute based on the current grammar", -> + expect(wrapperNode.dataset.grammar).toBe 'source js' + editor.setGrammar(atom.syntax.nullGrammar) + expect(wrapperNode.dataset.grammar).toBe 'text plain null-grammar' + buildMouseEvent = (type, properties...) -> properties = extend({bubbles: true, cancelable: true}, properties...) properties.detail ?= 1