Skip to content

Commit 5239f32

Browse files
authored
test(home): assert the hero logo keeps shrink-0 by class token (#117)
The assertion matched the whole class attribute as one string, so #115 adding `self-center sm:self-auto` for mobile stacking broke it even though the invariant it guards still held. The logo must keep `shrink-0` so the hero's flex row cannot squash it; responsive alignment classes around it are free to change. Verified the assertion still fails when shrink-0 is actually removed.
1 parent c19b0bc commit 5239f32

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/e2e/llm-endpoints.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ function hasLinkRelation(response: Response, target: string, relation: string):
5959
});
6060
}
6161

62+
function classTokens(tag: string | undefined): string[] {
63+
return (/class="([^"]*)"/.exec(tag ?? '')?.[1] ?? '').split(/\s+/).filter(Boolean);
64+
}
65+
6266
function hasActiveNavLink(body: string, href: string): boolean {
6367
return [...body.matchAll(/<a\b[^>]*>/g)].some(
6468
([tag]) => tag.includes(`href="${href}"`) && tag.includes('data-nav-active="true"'),
@@ -331,7 +335,9 @@ describe('.md suffix end-to-end', () => {
331335
expect(body.match(/<h1\b/g)).toHaveLength(1);
332336
expect(body.match(/<main\b/g)).toHaveLength(1);
333337
expect(body).toContain('<h1 class="text-3xl">Steel Documentation</h1>');
334-
expect(animatedLogo).toContain('class="shrink-0"');
338+
// The logo must keep shrink-0 so the hero's flex row cannot squash it. Responsive
339+
// alignment classes come and go around it, so assert the token, not the whole attribute.
340+
expect(classTokens(animatedLogo)).toContain('shrink-0');
335341
expect(body).toContain(
336342
'Steel is the open-source browser API for AI agents — managed cloud browsers with stealth, residential proxies, CAPTCHA solving, persistent profiles, session replays, and agent observability. Use these docs to create cloud browser sessions and connect your automation tools.',
337343
);

0 commit comments

Comments
 (0)