From ecf237697b77babd601a129202cb1f5fdbec507d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 25 Aug 2014 10:22:44 -0700 Subject: [PATCH] Add react editor view spec for data grammar attrs --- spec/editor-component-spec.coffee | 6 ++++++ 1 file changed, 6 insertions(+) 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