nixite/testing/site.test.nix
2023-12-31 00:24:48 +00:00

28 lines
797 B
Nix

let
elems = import ../nixite/elems.nix;
site = import ../nixite/site.nix;
it = import ./it.nix;
in
with site; [
(it "applies a style" {
expected = {
"index.html" = with elems; (doc [(title "foobar") (stylesheet "/style.css")] [(main "something")]);
blog = {
"index.html" = with elems; (doc [(title "foobar") (stylesheet "/style.css")] [(main "blogy blog")]);
};
"style.css" = ''
this is a stylesheet
'';
};
actual =
applyStyle ''
this is a stylesheet
'' {
"index.html" = with elems; (doc [(title "foobar")] [(main "something")]);
blog = {
"index.html" = with elems; (doc [(title "foobar")] [(main "blogy blog")]);
};
};
})
]