Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix / favicon paths #181

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions platforms/web/scripts/build-tools/buildTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export const getGoogleFontTags = (fonts: ExternalFont[]): HtmlTagDescriptor[] =>

export const generateIconTags = (basePath: string, favIconSizes: number[], appleIconSizes: number[]) => {
const favIconTags = favIconSizes.map((size) => {
return `<link rel="icon" type="image/png" sizes="${size}x${size}" href="${basePath}/favicon-${size}x${size}.png">`;
return `<link rel="icon" type="image/png" sizes="${size}x${size}" href="${basePath}pwa-${size}x${size}.png">`;
});
const appleIconTags = appleIconSizes.map((size) => {
return `<link rel="apple-touch-icon" href="${basePath}/apple-touch-icon-${size}x${size}.png">`;
return `<link rel="apple-touch-icon" href="${basePath}apple-touch-icon-${size}x${size}.png">`;
});
return [...favIconTags, ...appleIconTags].join('\n');
};
Expand Down
14 changes: 14 additions & 0 deletions platforms/web/test-e2e/tests/seo_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { testConfigs } from '@jwp/ott-testing/constants';

import { favIconSizes, appleIconSizes } from './../../pwa-assets.config';

import constants from '#utils/constants';

Feature('seo').retry(Number(process.env.TEST_RETRY_COUNT) || 0);
Expand All @@ -8,6 +10,18 @@ Before(({ I }) => {
I.useConfig(testConfigs.basicNoAuth);
});

Scenario('It renders all favicons correcty', ({ I }) => {
I.seeAttributesOnElements('link[sizes="any"]', { href: `${constants.baseUrl}images/icons/favicon.ico`, rel: 'icon', type: 'image/x-icon' });
for (const size of favIconSizes) {
const sizes = `${size}x${size}`;
I.seeAttributesOnElements(`link[sizes="${sizes}"]`, { href: `${constants.baseUrl}images/icons/pwa-${sizes}.png`, rel: 'icon', type: 'image/png' });
}
for (const size of appleIconSizes) {
const sizes = `${size}x${size}`;
I.seeElementInDOM(`link[rel="apple-touch-icon"][href="/images/icons/apple-touch-icon-${sizes}.png"]`);
}
});

Scenario('It renders the correct meta tags for the home screen', ({ I }) => {
I.seeTitleEquals('JW OTT Web App');

Expand Down
Loading