let
elems = import ../nixite/elems.nix;
html = import ../nixite/html.nix;
it = import ./it.nix;
in
with elems; [
(it "makes a p tag" {
expected = html.tag "p" {} "foobar";
actual = p "foobar";
})
(it "makes a main tag" {
expected = html.tag "main" {} ["yeet"];
actual = main ["yeet"];
})
(it "makes an h1 tag" {
expected = html.tag "h1" {} "foobar";
actual = h 1 "foobar";
})
(it "makes an h2 tag" {
expected = html.tag "h2" {} "foobar";
actual = h 2 "foobar";
})
(it "makes a title tag" {
expected = html.tag "title" {} "foobar";
actual = title "foobar";
})
(it "makes an a tag" {
expected = html.tag "a" {href = "https://example.com";} "example";
actual = link "https://example.com" "example";
})
(it "makes a stylesheet link" {
expected = html.tag "link" {
href = "/style";
rel = "stylesheet";
} "";
actual = stylesheet "/style";
})
(it "makes a list" {
expected = html.tag "ul" {} [
(html.tag "li" {} "foo")
(html.tag "li" {} "bar")
(html.tag "li" {} "baz")
];
actual = list ["foo" "bar" "baz"];
})
(it "makes an html doc" {
expected = html.tag "html" {lang = "en";} [
(html.tag "head" {} ["foo"])
(html.tag "body" {} "bar")
];
actual = doc ["foo"] "bar";
})
]