-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: host fonts in the public directory
- Loading branch information
1 parent
87728b4
commit 433e03b
Showing
8 changed files
with
96 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.describe('Fonts', () => { | ||
test('verify fonts are served correctly', async ({ page }) => { | ||
const fonts = [ | ||
// DNB | ||
'dnb/DNB-Regular.woff2', | ||
'dnb/DNB-Medium.woff2', | ||
'dnb/DNB-Bold.woff2', | ||
'dnb/DNBMono-Regular.woff2', | ||
'dnb/DNBMono-Medium.woff2', | ||
'dnb/DNBMono-Bold.woff2', | ||
'dnb/skeleton/DNB-Skeleton-Regular.woff2', | ||
'dnb/skeleton/DNB-Skeleton-Medium.woff2', | ||
'dnb/skeleton/DNB-Skeleton-Bold.woff2', | ||
|
||
// Sbanken | ||
'sbanken/MaisonNeue.woff2', | ||
'sbanken/Roboto-Regular.woff2', | ||
'sbanken/Roboto-Medium.woff2', | ||
'sbanken/Roboto-Bold.woff2', | ||
] | ||
|
||
for await (const font of fonts) { | ||
const url = `/fonts/${font}` | ||
const response = await page.request.get(url) | ||
console.log('response', response) | ||
expect(response.status()).toBe(200) | ||
expect(response.headers()['content-type']).toContain('font') // Ensure it's a font file | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters