nixite/testing/site.test.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2023-12-31 00:24:48 +00:00
let
html = import ../nixite/html.nix;
2023-12-31 00:24:48 +00:00
elems = import ../nixite/elems.nix;
site = import ../nixite/site.nix;
it = import ./it.nix;
in
with site; [
(it "applies a style" {
expected = {
"index.html" = html.tag "html" {} [
(html.tag "head" {} [(elems.title {} "foobar") (elems.stylesheet "/style.css")])
(elems.main {} "something")
];
2023-12-31 00:24:48 +00:00
blog = {
"index.html" = html.tag "html" {} [
(html.tag "head" {} [(elems.title {} "foobar") (elems.stylesheet "/style.css")])
(elems.main {} "blogy blog")
];
2023-12-31 00:24:48 +00:00
};
"style.css" = ''
this is a stylesheet
'';
};
actual =
applyStyle ''
this is a stylesheet
'' {
"index.html" = html.tag "html" {} [
(html.tag "head" {} [(elems.title {} "foobar")])
(elems.main {} "something")
];
2023-12-31 00:24:48 +00:00
blog = {
"index.html" = html.tag "html" {} [
(html.tag "head" {} [(elems.title {} "foobar")])
(elems.main {} "blogy blog")
];
2023-12-31 00:24:48 +00:00
};
};
})
]