Download this file
| 1 | package slidestest |
| 2 | |
| 3 | import ( |
| 4 | "bytes" |
| 5 | "os" |
| 6 | "path/filepath" |
| 7 | "testing" |
| 8 | |
| 9 | "amadan.net/oficina/estilo.git/theme" |
| 10 | ) |
| 11 | |
| 12 | // The layout names Onest's stylesheet by a literal path; this keeps that |
| 13 | // literal equal to estilo's versioned prefix, so an estilo font move |
| 14 | // fails here rather than every page quietly falling back to the system |
| 15 | // face. |
| 16 | func TestLayoutLinksEstilosFonts(t *testing.T) { |
| 17 | layout, err := os.ReadFile(filepath.Join("..", "slides", "templates", "layout.html")) |
| 18 | if err != nil { |
| 19 | t.Fatal(err) |
| 20 | } |
| 21 | if want := `href="` + theme.FontPrefix + `fonts.css"`; !bytes.Contains(layout, []byte(want)) { |
| 22 | t.Errorf("layout.html does not link %s", want) |
| 23 | } |
| 24 | } |
| 25 | |