Compare commits
3 commits
de35dbb953
...
1c3f2565c7
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c3f2565c7 | |||
| 4f71a20c67 | |||
| 9952654af1 |
3 changed files with 24 additions and 11 deletions
20
fwt/components/Head/Head.tsx
Normal file
20
fwt/components/Head/Head.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
interface Props {
|
||||
title: string
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export default (props: Props) => {
|
||||
return (
|
||||
<>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="name" content={props.name} />
|
||||
<meta name="description" content={props.description} />
|
||||
<title>{props.title}</title>
|
||||
</head>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
@ -6,20 +6,13 @@ const websiteDescription = 'This is just a template.'
|
|||
|
||||
import Background from '../../fwt/components/Background/Background'
|
||||
import OptimizeBackground from '../../fwt/components/Optimizer/OptimizeBackground'
|
||||
import Head from '../../fwt/components/Head/Head'
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="name" content={websiteName} />
|
||||
<meta name="description" content={websiteDescription} />
|
||||
<title>{title}</title>
|
||||
</head>
|
||||
<Head title={title} name={websiteName} description={websiteDescription} />
|
||||
|
||||
<body id="body">
|
||||
<!-- <OptimizeBackground /> -->
|
||||
<Background color="#0c1b31" />
|
||||
<slot />
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'
|
|||
test('page loaded correctly', async ({ page }) => {
|
||||
await page.goto('http://localhost:4321')
|
||||
|
||||
await expect(page).toHaveTitle('Home')
|
||||
await expect(page).toHaveTitle('FWT')
|
||||
|
||||
const descriptionMeta = await page.getAttribute('meta[name="name"]', 'content')
|
||||
expect(descriptionMeta).toBe('Template')
|
||||
|
|
@ -23,5 +23,5 @@ test('header title is visible and contains correct text', async ({ page }) => {
|
|||
await page.goto('http://localhost:4321')
|
||||
|
||||
const headerTitle = await page.textContent('h1')
|
||||
expect(headerTitle).toBe('Main Page')
|
||||
expect(headerTitle).toBe('Fast WebApp Template')
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue