commit b36061d309edb0c672f6a5c43ae4352fc81089f7
parent 67f74110c0e2babac75801952bd071f513dc6d14
Author: MTRNord <mtrnord1@gmail.com>
Date: Thu, 20 Jan 2022 20:49:04 +0100
Fix the e2e tests
Diffstat:
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/components/Header.tsx b/components/Header.tsx
@@ -10,7 +10,7 @@ export default class Header extends PureComponent {
<header className='bg-[#f8f8f8] dark:bg-[#06070D] flex fixed top-0 left-0 right-0 lg:h-20 h-auto z-[100] items-center lg:flex-row flex-col shadow-black drop-shadow-xl'>
<span className='flex items-center lg:mx-10 lg:my-auto my-4 text-gray-900 dark:text-gray-200 font-bold cursor-pointer'>
<Link href="/" passHref>
- <svg width="8.75rem" className="fill-gray-900 dark:fill-gray-200" viewBox="0 0 400 82" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <svg id="matrix-art-logo" width="8.75rem" className="fill-gray-900 dark:fill-gray-200" viewBox="0 0 400 82" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M105.578 67.4062C101.016 76.5312 94.5312 81.0938 86.125 81.0938C77.7812 81.0938 71.8125 75.4688 68.2188 64.2188C65.8438 56.7812 64.6562 47.7188 64.6562 37.0312C64.6562 33.0625 64.8125 28.8594 65.125 24.4219C59 36.3906 54.2344 48.2188 50.8281 59.9062H32.875L32.9219 24.3281C26.8594 36.3281 22.2031 48.1875 18.9531 59.9062H0.015625C12.6094 41.1875 22.5312 21.3125 29.7812 0.28125H48.5312C46.7188 11.5938 45.7656 23.4375 45.6719 35.8125C51.6719 23.4688 57.1406 11.625 62.0781 0.28125H83.4062C80.0625 8.84375 78.3906 17.9688 78.3906 27.6562C78.3906 28.875 78.4375 30.3906 78.5312 32.2031C78.8438 38.4844 79.2969 43.2031 79.8906 46.3594C80.7656 51.0469 82.2344 55.5156 84.2969 59.7656C87.7031 66.7656 91.7344 70.2656 96.3906 70.2656C101.141 70.2656 104.203 69.3125 105.578 67.4062Z" fill="inherit" />
<path d="M132.062 18.8438C126.781 32.5312 122.609 46.2188 119.547 59.9062H103.844L104.547 57.6094C101.516 59.3281 98.4062 60.1875 95.2188 60.1875C91 60.1875 87.7031 58.7344 85.3281 55.8281C83.1094 53.1406 82 49.6406 82 45.3281C82 38.7656 84.1562 32.75 88.4688 27.2812C93.0938 21.4375 98.5781 18.5156 104.922 18.5156C109.578 18.5156 112.969 20 115.094 22.9688L116.359 18.8438H132.062ZM110.547 33.8906C110.547 30.6094 108.938 28.9688 105.719 28.9688C103.438 28.9688 101.422 29.9375 99.6719 31.875C97.9219 33.8125 97.0469 35.9375 97.0469 38.25C97.0469 41.6875 98.75 43.4062 102.156 43.4062C104.562 43.4062 106.594 42.4062 108.25 40.4062C109.781 38.5312 110.547 36.3594 110.547 33.8906Z" fill="inherit" />
<path d="M167.547 18.5156L163.656 31.4531C160.344 31.3281 157.141 31.2188 154.047 31.125C151.234 40.4062 148.953 50 147.203 59.9062H130C132.844 52.625 136.016 43.0156 139.516 31.0781C136.234 31.1719 133.062 31.2969 130 31.4531L133.938 18.5156C136.844 18.6719 139.891 18.7812 143.078 18.8438C144.453 13.8438 145.891 8.5 147.391 2.8125H164.734C162.328 8.09375 160.141 13.4375 158.172 18.8438C161.172 18.75 164.297 18.6406 167.547 18.5156Z" fill="inherit" />
diff --git a/e2e/home.spec.ts b/e2e/home.spec.ts
@@ -17,7 +17,17 @@ test('test navigation to details', async ({ page }) => {
page.click('text=FlowersMTRNord @ Art')
]);
- await page.locator('a:text("Matrix Art")').waitFor();
- await page.click('a:text("Matrix Art")');
+ await expect(page).toHaveURL('http://localhost:3000/post/%24xoIMe7tUMb2NhCBZaxsZr2CVkptCVu1GaJ_eJMKbJQo');
+ // Click img[alt="Flowers"]
+ await page.click('img[alt="Flowers"]');
+ // Click [aria-label="Close gallery"]
+ await page.click('[aria-label="Close gallery"]');
+ await expect(page).toHaveURL('http://localhost:3000/post/%24xoIMe7tUMb2NhCBZaxsZr2CVkptCVu1GaJ_eJMKbJQo');
+
+ // Click svg
+ await Promise.all([
+ page.waitForNavigation(/*{ url: 'http://localhost:3000/' }*/),
+ page.click('#matrix-art-logo')
+ ]);
await expect(page).toHaveURL('http://localhost:3000/');
});
\ No newline at end of file