From 348f865cab168995d4a83d0d0525e7beeaba3d07 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 17 Sep 2014 09:47:40 -0700 Subject: [PATCH] Add spec for all whitespace lines --- spec/editor-component-spec.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index f52e4a0a5..3a9e2a904 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -211,6 +211,18 @@ describe "EditorComponent", -> expect(leafNodes[0].classList.contains('leading-whitespace')).toBe true it "applies .trailing-whitespace for lines with trailing spaces and/or tabs", -> + editor.setText(' ') + nextAnimationFrame() + + leafNodes = getLeafNodes(component.lineNodeForScreenRow(0)) + expect(leafNodes[0].classList.contains('trailing-whitespace')).toBe true + + editor.setText('\t') + nextAnimationFrame() + + leafNodes = getLeafNodes(component.lineNodeForScreenRow(0)) + expect(leafNodes[0].classList.contains('trailing-whitespace')).toBe true + editor.setText('a ') nextAnimationFrame()