Commit 66320d00 authored by tom's avatar tom

inline fonts and mock date globally

parent 736e6bf2
This diff is collapsed.
...@@ -4,38 +4,6 @@ ...@@ -4,38 +4,6 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Testing Page</title> <title>Testing Page</title>
<style>
@font-face {
font-family: Poppins;
src: url(/playwright/fonts/Poppins/Poppins-SemiBold.ttf);
font-weight: 600;
}
@font-face {
font-family: Poppins;
src: url(/playwright/fonts/Poppins/Poppins-Medium.ttf);
font-weight: 500;
}
@font-face {
font-family: Poppins;
src: url(/playwright/fonts/Poppins/Poppins-Regular.ttf);
font-weight: 400;
}
@font-face {
font-family: Inter;
src: url(/playwright/fonts/Inter/Inter-SemiBold.ttf);
font-weight: 600;
}
@font-face {
font-family: Inter;
src: url(/playwright/fonts/Inter/Inter-Medium.ttf);
font-weight: 500;
}
@font-face {
font-family: Inter;
src: url(/playwright/fonts/Inter/Inter-Regular.ttf);
font-weight: 400;
}
</style>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
......
// Import styles, initialize component theme here. import './fonts.css';
// import '../src/common.css'; import { beforeMount } from '@playwright/experimental-ct-react/hooks';
import MockDate from 'mockdate';
import * as router from 'next/router';
beforeMount(async({ hooksConfig }) => {
// Before mount, redefine useRouter to return mock value from test.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: I really want to redefine this property :)
router.useRouter = () => hooksConfig.router;
// set current date
MockDate.set('2022-11-11');
});
export {}; export {};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment