fix: fix button style on Hero#270
fix: fix button style on Hero#270117Isabell wants to merge 1 commit intoWomen-Coding-Community:mainfrom
Conversation
Made-with: Cursor
|
| @@ -22,4 +28,15 @@ describe('LinkButton', () => { | |||
| expect(button.closest('a')).toHaveAttribute('target', '_blank'); | |||
| expect(button.closest('a')).toHaveAttribute('rel', 'noopener noreferrer'); | |||
| }); | |||
There was a problem hiding this comment.
The existing renders an external link test still calls bare render() — it was not updated alongside the internal test. Since sx now calls theme.typography.linkButtonContained, running without ThemeProvider means those custom variants resolve to undefined. Tests still pass (no style assertions), but this is inconsistent with the fix applied to the internal test.
- render(<LinkButton href="https://external.com">External Link</LinkButton>);
+ renderWithTheme(<LinkButton href="https://external.com">External Link</LinkButton>);| expect(link).toBeInTheDocument(); | ||
| expect(link.closest('a')).toHaveAttribute('href', 'https://external.com'); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
The outlined branch has two code paths — external (<a>) and internal (Next.js Link) — but only the external path is tested. A companion test would complete the coverage:
it("renders an outlined internal link", () => {
renderWithTheme(
<LinkButton href="/internal" outlined>
Outlined Internal
</LinkButton>,
);
const link = screen.getByRole("link", { name: /outlined internal/i });
expect(link).toBeInTheDocument();
expect(link.closest("a")).toHaveAttribute("href", "/internal");
});
womencodingcommunity
left a comment
There was a problem hiding this comment.
Great contribution! The outlined prop is well-structured, the theme token centralisation is clean, and wrapping tests with ThemeProvider was the right fix. The two inline notes are optional follow-ups (wrap the external link test in renderWithTheme for consistency, and add a test for the internal outlined path) — neither blocks merge.



Description
Updates the home page hero “Join our Slack” control from a plain underlined
Linkto the sharedLinkButtoncomponent with an outlined style so it matches design: pill shape, M3 outline border (#71787E), primary label colour, no underline, and label typography aligned with Figma (14px / medium weight / line-height / letter-spacing).LinkButtonoutlinedprop: MUIvariant="outlined", same external (https) vs internal behaviour as before (<a target="_blank">vs NextLink).theme.typographyinstead of hard-coded font rules in the component.theme.palette.custom.outline.theme.tspalette.custom.outline(#71787E, M3 sys/light/outline).outlineButton,outlineButtonSmall,linkButtonContained,linkButtonContainedSmall.Other
LinkButtonunit tests: wrapped withThemeProviderso theme tokens resolve.Type
Related Issue
Screenshots
before:

Now:

Testing
pnpm test -- LinkButton.testpnpm testmay show unrelated failures (e.g. mentee registration test timeout).Pull request checklist
Please check if your PR fulfills the following requirements: