Skip to content

Commit

Permalink
Add test for @next/font
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Bornö committed Feb 24, 2023
1 parent 3a73e4d commit 1bca0f7
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/e2e/app-dir/next-font/app-old/navigation/font.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import localFont from '@next/font/local'

export const font = localFont({ src: './font.woff2' })
1 change: 1 addition & 0 deletions test/e2e/app-dir/next-font/app-old/navigation/font.woff2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
font.woff2
12 changes: 12 additions & 0 deletions test/e2e/app-dir/next-font/app-old/navigation/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { font } from './font'

export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<p className={font.className}>LAYOUT1</p>
{children}
</body>
</html>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { font } from '../font'

export default function Page() {
return (
<p id="page-with-same-font" className={font.className}>
Page with same font
</p>
)
}
11 changes: 11 additions & 0 deletions test/e2e/app-dir/next-font/app-old/navigation/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Link from 'next/link'

export default function Page() {
return (
<>
<Link href="/navigation/page-with-same-font">
Go to page with same font
</Link>
</>
)
}

0 comments on commit 1bca0f7

Please sign in to comment.