fix: preserve journey geometry and mailto placement

This commit is contained in:
2026-09-04 21:02:44 +03:00
parent 7d9e3c2eac
commit 242d79599a
7 changed files with 44 additions and 11 deletions

View File

@@ -102,6 +102,20 @@ test('exposes the complete semantic portfolio from the generated document', asyn
await expect(page.getByRole('link', { name: 'Explore work' })).toHaveAttribute('href', '#selected-builds');
await expect(page.getByRole('link', { name: 'Email Luca' })).toHaveCount(2);
await expect(page.locator('[data-featured-operation]')).toContainText('without data loss');
expect(await page.locator('[data-testid="toolkit-technology"]', { hasText: 'DNS' }).locator('span').evaluate(
(label) => getComputedStyle(label).gridColumn,
)).toBe('1 / -1');
expect(await page.locator('.hero-journey').evaluate((hero) => {
const content = hero.querySelector('.hero-journey__content')!;
const heroStyle = getComputedStyle(hero);
const contentStyle = getComputedStyle(content);
return {
preservesPadding: Math.abs(Number.parseFloat(heroStyle.paddingTop) - innerHeight * 0.12) < 0.01,
preservesWidth: Math.abs(Number.parseFloat(contentStyle.width) - Math.min(544, innerWidth * 0.39)) < 0.1,
position: contentStyle.position,
zIndex: contentStyle.zIndex,
};
})).toEqual({ preservesPadding: true, preservesWidth: true, position: 'static', zIndex: 'auto' });
expect(
await page.locator('h1, h2, h3').evaluateAll((headings) => {
const levels = headings.map((heading) =>

View File

@@ -131,6 +131,16 @@ describe('artifact verification', () => {
name: 'a mailto link with an address that differs from public content',
mutate: (html: string) => html.replace('href="mailto:luca.pislaru@gmail.com">Email Luca</a>', 'href="mailto:wrong@example.test">Email Luca</a>'),
},
{
name: 'a hidden mailto link outside the app root',
mutate: (html: string) => html.replace('</body>', '<a hidden href="mailto:luca.pislaru@gmail.com">Email Luca</a></body>'),
},
{
name: 'two mailto links placed beneath contact instead of one per section',
mutate: (html: string) => html
.replace('href="mailto:luca.pislaru@gmail.com">Email Luca</a>', 'href="#selected-builds">Email Luca</a>')
.replace('</footer>', '<a href="mailto:luca.pislaru@gmail.com">Email Luca</a></footer>'),
},
])('rejects $name', async ({ mutate }) => {
const { directory, html, inputs, contract } = await writeValidArtifacts();
await writeFile(join(directory, 'index.html'), mutate(html));

View File

@@ -171,6 +171,7 @@ describe("semantic section components", () => {
expect(tile.text()).toBe("DNS");
expect(tile.find("svg").exists()).toBe(false);
expect(tile.get("span").classes()).toContain("toolkit-item__label--text-only");
});
it("renders a visible mailto contact and safe verified social links", () => {