mirror of
https://github.com/oekazuma/svelte-meta-tags.git
synced 2025-12-11 20:15:14 +01:00
test: improvement of icon and manifest
This commit is contained in:
parent
9cc2c5ef9c
commit
e33fbfaff1
@ -364,7 +364,7 @@ additionalLinkTags={[
|
||||
},
|
||||
{
|
||||
rel: 'manifest',
|
||||
href: '/manifest.json'
|
||||
href: 'https://www.test.ie/manifest.json'
|
||||
}
|
||||
]}
|
||||
```
|
||||
@ -374,7 +374,7 @@ it will result in this being rendered:
|
||||
```html
|
||||
<link rel="icon" href="https://www.test.ie/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="https://www.test.ie/touch-icon-ipad.jpg" sizes="76x76" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<link rel="manifest" href="https://www.test.ie/manifest.json" />
|
||||
```
|
||||
|
||||
## Open Graph
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
additionalLinkTags={[
|
||||
{
|
||||
rel: 'icon',
|
||||
href: 'https://www.test.ie/favicon.ico'
|
||||
href: '/favicon.ico'
|
||||
},
|
||||
{
|
||||
rel: 'apple-touch-icon',
|
||||
@ -57,7 +57,7 @@
|
||||
},
|
||||
{
|
||||
rel: 'manifest',
|
||||
href: '/manifest.json'
|
||||
href: 'https://www.test.ie/manifest.json'
|
||||
}
|
||||
]}
|
||||
/>
|
||||
|
||||
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
3
static/robots.txt
Normal file
3
static/robots.txt
Normal file
@ -0,0 +1,3 @@
|
||||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
@ -1,6 +1,6 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Normal SEO loads correctly', async ({ page }) => {
|
||||
test('Normal SEO loads correctly', async ({ page, baseURL }) => {
|
||||
await page.goto('/');
|
||||
await expect(page).toHaveTitle('Normal | Svelte Meta Tags');
|
||||
await expect(page.locator('h1')).toContainText('Normal SEO');
|
||||
@ -41,7 +41,7 @@ test('Normal SEO loads correctly', async ({ page }) => {
|
||||
'https://www.example.ie/twitter-image.jpg'
|
||||
);
|
||||
await expect(page.locator('head meta[name="twitter:image:alt"]')).toHaveAttribute('content', 'Twitter image alt');
|
||||
await expect(page.locator('head link[rel="icon"]')).toHaveAttribute('href', 'https://www.test.ie/favicon.ico');
|
||||
await expect(page.locator('head link[rel="icon"]')).toHaveAttribute('href', `${baseURL}/favicon.ico`);
|
||||
const appleTouchIcon = page.locator('head link[rel="apple-touch-icon"]');
|
||||
await expect(appleTouchIcon).toHaveCount(2);
|
||||
await expect(appleTouchIcon.nth(0)).toHaveAttribute('sizes', '76x76');
|
||||
@ -49,5 +49,5 @@ test('Normal SEO loads correctly', async ({ page }) => {
|
||||
const maskIcon = page.locator('head link[rel="mask-icon"]');
|
||||
await expect(maskIcon).toHaveAttribute('href', 'https://www.test.ie/safari-pinned-tab.svg');
|
||||
await expect(maskIcon).toHaveAttribute('color', '#193860');
|
||||
await expect(page.locator('head link[rel="manifest"]')).toHaveAttribute('href', '/manifest.json');
|
||||
await expect(page.locator('head link[rel="manifest"]')).toHaveAttribute('href', 'https://www.test.ie/manifest.json');
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user