add test for markdown
This commit is contained in:
parent
e87fa125bb
commit
2ac2e1ec01
1 changed files with 26 additions and 20 deletions
|
@ -1,25 +1,31 @@
|
|||
defmodule ChiyaWeb.MarkdownTest do
|
||||
use Chiya.DataCase
|
||||
use Chiya.DataCase
|
||||
|
||||
alias ChiyaWeb.Markdown
|
||||
alias ChiyaWeb.Markdown
|
||||
|
||||
describe "render/1" do
|
||||
test "renders simple markdown" do
|
||||
html = Markdown.render("# Title")
|
||||
assert html =~ "id=\"title\""
|
||||
assert html =~ "Title"
|
||||
assert html =~ "</h1>"
|
||||
end
|
||||
describe "render/1" do
|
||||
test "renders simple markdown" do
|
||||
html = Markdown.render("# Title")
|
||||
assert html =~ "id=\"title\""
|
||||
assert html =~ "Title"
|
||||
assert html =~ "</h1>"
|
||||
end
|
||||
|
||||
test "renders a link to a note" do
|
||||
html = Markdown.render("[[foo]]")
|
||||
assert html =~ "/note/foo"
|
||||
end
|
||||
test "renders a link to a note" do
|
||||
html = Markdown.render("[[foo]]")
|
||||
assert html =~ "/note/foo"
|
||||
end
|
||||
|
||||
test "renders a link to a note with custom title" do
|
||||
html = Markdown.render("[[foo|MyFoo]]")
|
||||
assert html =~ "/note/foo"
|
||||
assert html =~ "MyFoo"
|
||||
end
|
||||
end
|
||||
test "renders a link to a note with custom title" do
|
||||
html = Markdown.render("[[foo|MyFoo]]")
|
||||
assert html =~ "/note/foo"
|
||||
assert html =~ "MyFoo"
|
||||
end
|
||||
|
||||
test "renders a link to a not existing note with custom class" do
|
||||
html = Markdown.render("[[foo]]")
|
||||
assert html =~ "/note/foo"
|
||||
assert html =~ "class=\"invalid\""
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue