summaryrefslogtreecommitdiff
path: root/test/clarktown/renderers/heading_block_test.clj
diff options
context:
space:
mode:
authorAsko Nõmm <84135165+askonomm@users.noreply.github.com>2022-04-23 02:43:49 +0300
committerGitHub <noreply@github.com>2022-04-23 02:43:49 +0300
commit70d88384ea788f7b2ad5ebb725762f7d27300504 (patch)
treeb371f12617949daf2b40538ba9a2e4457b657d0f /test/clarktown/renderers/heading_block_test.clj
parent059bfa7bd9bfdde0c75646bf1dfc20d23da8a02c (diff)
parentdc921cbe1c786995a8670efd9f5556ee9df064f9 (diff)
Merge pull request #17 from askonomm/16-improve-architecture
Improve architecture
Diffstat (limited to 'test/clarktown/renderers/heading_block_test.clj')
-rw-r--r--test/clarktown/renderers/heading_block_test.clj44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/clarktown/renderers/heading_block_test.clj b/test/clarktown/renderers/heading_block_test.clj
new file mode 100644
index 0000000..2196422
--- /dev/null
+++ b/test/clarktown/renderers/heading_block_test.clj
@@ -0,0 +1,44 @@
+(ns clarktown.renderers.heading-block-test
+ (:require
+ [clojure.test :refer [deftest testing is]]
+ [clarktown.renderers.heading-block :as heading-block]))
+
+
+(deftest atx-heading-renderer-test
+ (testing "Hashbang heading block that's a H1"
+ (is (= "<h1>This is a heading block.</h1>"
+ (heading-block/render "# This is a heading block." nil nil))))
+
+ (testing "Hashbang heading block that's a H2"
+ (is (= "<h2>This is a heading block.</h2>"
+ (heading-block/render "## This is a heading block." nil nil))))
+
+ (testing "Hashbang heading block that's a H3"
+ (is (= "<h3>This is a heading block.</h3>"
+ (heading-block/render "### This is a heading block." nil nil))))
+
+ (testing "Hashbang heading block that's a H4"
+ (is (= "<h4>This is a heading block.</h4>"
+ (heading-block/render "#### This is a heading block." nil nil))))
+
+ (testing "Hashbang heading block that's a H5"
+ (is (= "<h5>This is a heading block.</h5>"
+ (heading-block/render "##### This is a heading block." nil nil)))))
+
+
+(deftest settext-heading-renderer-text
+ (testing "Settext heading block that's a H1"
+ (is (= "<h1>This is a heading block.</h1>"
+ (heading-block/render "This is a heading block.\n=========" nil nil))))
+
+ (testing "Settext heading block that's a H1 spanning multiple lines"
+ (is (= "<h1>This is a \nheading block spanning multiple lines.</h1>"
+ (heading-block/render "This is a \nheading block spanning multiple lines.\n========" nil nil))))
+
+ (testing "Settext heading block that's a H2"
+ (is (= "<h2>This is a heading block.</h2>"
+ (heading-block/render "This is a heading block.\n---------" nil nil))))
+
+ (testing "Settext heading block that's a H2 spanning multiple lines"
+ (is (= "<h2>This is a \nheading block spanning multiple lines.</h2>"
+ (heading-block/render "This is a \nheading block spanning multiple lines.\n--------" nil nil))))) \ No newline at end of file