Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Add tests on edit-line 🍵
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuochun committed Sep 23, 2018
1 parent 086a187 commit 53f89fb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/commands/edit-line-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,18 @@ describe "EditLine", ->
editLine.trigger(event)
expect(editor.getText()).toBe(" - list")

it "indent line if it is an unordered list (ulBullet config)", ->
atom.config.set("markdown-writer.templateVariables.ulBullet1", "*")
atom.config.set("markdown-writer.templateVariables.ulBullet2", "+")

editor.setText "- list"
editor.setCursorBufferPosition([0, 5])

editLine.trigger(event)
expect(editor.getText()).toBe(" * list")
editLine.trigger(event)
expect(editor.getText()).toBe(" + list")

it "indent line if it is an ordered list", ->
editor.setText "3. list"
editor.setCursorBufferPosition([0, 5])
Expand Down Expand Up @@ -368,6 +380,17 @@ describe "EditLine", ->
expect(editor.getText()).toBe("- list")
expect(editor.getCursorBufferPosition().toString()).toBe("(0, 3)")

it "undent line if it is an unordered list (ulBullet config)", ->
atom.config.set("markdown-writer.templateVariables.ulBullet1", "*")

editor.setText " + list"
editor.setCursorBufferPosition([0, 5])

editLine.trigger(event)
expect(editor.getText()).toBe(" * list")
editLine.trigger(event)
expect(editor.getText()).toBe("- list")

it "undent line if it is an ordered list", ->
editor.setText " 3. list"
editor.setCursorBufferPosition([0, 9])
Expand Down

0 comments on commit 53f89fb

Please sign in to comment.