diff options
Diffstat (limited to 'test/clarktown/parsers/link_and_image_test.clj')
| -rw-r--r-- | test/clarktown/parsers/link_and_image_test.clj | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/clarktown/parsers/link_and_image_test.clj b/test/clarktown/parsers/link_and_image_test.clj new file mode 100644 index 0000000..eadfc58 --- /dev/null +++ b/test/clarktown/parsers/link_and_image_test.clj @@ -0,0 +1,20 @@ +(ns clarktown.parsers.link-and-image-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.parsers.link-and-image :as link-and-image])) + + +(deftest link-test + (testing "Creating a link" + (is (= (link-and-image/render "[This is a link.](https://example.com)" nil) + "<a href=\"https://example.com\">This is a link.</a>")) + + (is (= (link-and-image/render "[x] [label](link)" nil) + "[x] <a href=\"link\">label</a>")) + + (is (= (link-and-image/render "[ ] [label](link)" nil) + "[ ] <a href=\"link\">label</a>"))) + + (testing "Creating an image" + (is (= (link-and-image/render "" nil) + "<img src=\"https://example.com\" alt=\"This is an image\">"))))
\ No newline at end of file |
