diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-01 16:19:55 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-01 16:19:55 +0300 |
| commit | 227bf11efc3b1a65c75d0bb99099e37420128b12 (patch) | |
| tree | 47aed97f2c41873c8565266c82981dc4f2124f11 /integrationtests | |
| parent | 8fce1ed70c57b180059da423a544ddbf1b47342a (diff) | |
va self-host retrofuture webfonts
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/integration_test.go | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/integrationtests/integration_test.go b/integrationtests/integration_test.go index 526816d..ae67dfc 100644 --- a/integrationtests/integration_test.go +++ b/integrationtests/integration_test.go @@ -457,9 +457,28 @@ func TestThemeSelection(t *testing.T) { t.Fatalf("theme asset %s is empty", path) } } - if theme == "matrix" || theme == "retro" { + fontAssets := map[string][]string{ + "matrix": {"VT323-Regular.woff2", "FONT_LICENSE.txt"}, + "retro": {"VT323-Regular.woff2", "FONT_LICENSE.txt"}, + "retrofuture": { + "FONT_LICENSE.txt", + "orbitron-v35-latin_latin-ext-700.woff2", + "orbitron-v35-latin_latin-ext-regular.woff2", + "share-tech-mono-v16-latin_latin-ext-regular.woff2", + }, + } + fontURLs := map[string][]string{ + "matrix": {"url('VT323-Regular.woff2')"}, + "retro": {"url('VT323-Regular.woff2')"}, + "retrofuture": { + "url('orbitron-v35-latin_latin-ext-700.woff2')", + "url('orbitron-v35-latin_latin-ext-regular.woff2')", + "url('share-tech-mono-v16-latin_latin-ext-regular.woff2')", + }, + } + if assets, ok := fontAssets[theme]; ok { themeDir := filepath.Join(outputDir, "themes", theme) - for _, fname := range []string{"VT323-Regular.woff2", "FONT_LICENSE.txt"} { + for _, fname := range assets { path := filepath.Join(themeDir, fname) info, err := os.Stat(path) if err != nil { @@ -471,7 +490,9 @@ func TestThemeSelection(t *testing.T) { } themeCSS := readFile(t, filepath.Join(themeDir, "theme.css")) - assertContains(t, themeCSS, "url('VT323-Regular.woff2')", theme+" local font URL") + for _, fontURL := range fontURLs[theme] { + assertContains(t, themeCSS, fontURL, theme+" local font URL") + } for _, forbidden := range []string{"googleapis", "gstatic", "fonts.cdn", "@import url(http"} { if strings.Contains(themeCSS, forbidden) { t.Fatalf("%s theme.css contains runtime third-party font reference %q", theme, forbidden) |
