diff --git a/e2e/site.spec.ts b/e2e/site.spec.ts index 68f6a45..5b494a5 100644 --- a/e2e/site.spec.ts +++ b/e2e/site.spec.ts @@ -31,6 +31,31 @@ test.describe('Homepage', () => { const footer = page.locator('footer'); await expect(footer).toBeInViewport(); }); + + test('shows only official social links in the footer', async ({ page }) => { + await page.goto('/'); + + const socialLinks = page.locator('footer').getByTestId('social-links'); + + await expect(socialLinks.getByRole('link', { name: /podcodar no github/i })).toHaveAttribute( + 'href', + 'https://github.com/podcodar/' + ); + await expect(socialLinks.getByRole('link', { name: /podcodar no linkedin/i })).toHaveAttribute( + 'href', + 'https://www.linkedin.com/company/podcodar/' + ); + await expect(socialLinks.getByRole('link', { name: /podcodar no instagram/i })).toHaveAttribute( + 'href', + 'https://www.instagram.com/podcodar/' + ); + await expect(socialLinks.getByRole('link', { name: /podcodar no youtube/i })).toHaveAttribute( + 'href', + 'https://www.youtube.com/@podcodar5070/' + ); + + await expect(socialLinks.getByRole('link')).toHaveCount(4); + }); }); // ────────────────────────────────────────────────────────────────────────────── diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 34be428..140dd31 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,7 +1,6 @@ --- -import { Icon } from 'astro-icon/components'; import Logo from '@/components/Logo.astro'; -import { footerSocialIconify, footerSocialLinks } from '@/data/social-links'; +import SocialLinks from '@/components/SocialLinks.astro'; import { getLangFromUrl, useTranslations } from '@/i18n/utils'; const today = new Date(); @@ -14,25 +13,5 @@ const t = useTranslations(lang);

© {today.getFullYear()} PodCodar. {t('footer.copyright')}

-
- { - footerSocialLinks.map((link) => ( - - {link.label} - - )) - } -
+ diff --git a/src/components/SocialLinks.astro b/src/components/SocialLinks.astro new file mode 100644 index 0000000..f9daad5 --- /dev/null +++ b/src/components/SocialLinks.astro @@ -0,0 +1,20 @@ +--- +import { Icon } from 'astro-icon/components'; +import { socialIconify, socialLinks } from '@/data/social-links'; +--- + +
+ { + socialLinks.map((link) => ( + + {link.label} + + )) + } +
diff --git a/src/data/social-links.ts b/src/data/social-links.ts index 3485ace..2a7d8d4 100644 --- a/src/data/social-links.ts +++ b/src/data/social-links.ts @@ -1,9 +1,11 @@ /** * Footer / social presence. Update hrefs if a handle or invite URL changes. */ -export type SocialNetwork = 'github' | 'linkedin' | 'instagram' | 'youtube' | 'x' | 'discord'; +const SOCIAL_LINKS = ['github', 'linkedin', 'instagram', 'youtube'] as const; -export type FooterSocialLink = { +export type SocialNetwork = (typeof SOCIAL_LINKS)[number]; + +export type SocialLink = { href: string; /** Screen reader label (pt-BR). */ label: string; @@ -11,19 +13,17 @@ export type FooterSocialLink = { }; /** Iconify ids for `astro-icon` + `@iconify-json/simple-icons`. */ -export const footerSocialIconify: Record = { +export const socialIconify: Record = { github: 'simple-icons:github', linkedin: 'simple-icons:linkedin', instagram: 'simple-icons:instagram', youtube: 'simple-icons:youtube', - x: 'simple-icons:x', - discord: 'simple-icons:discord', }; -export const footerSocialLinks: FooterSocialLink[] = [ +export const socialLinks: SocialLink[] = [ { network: 'github', - href: 'https://github.com/podcodar', + href: 'https://github.com/podcodar/', label: 'PodCodar no GitHub', }, { @@ -38,17 +38,7 @@ export const footerSocialLinks: FooterSocialLink[] = [ }, { network: 'youtube', - href: 'https://www.youtube.com/@podcodar', + href: 'https://www.youtube.com/@podcodar5070/', label: 'PodCodar no YouTube', }, - { - network: 'x', - href: 'https://x.com/podcodar', - label: 'PodCodar no X', - }, - { - network: 'discord', - href: 'https://discord.com/invite/podcodar', - label: 'PodCodar no Discord', - }, ]; diff --git a/src/data/transparency.ts b/src/data/transparency.ts index 8dc9d99..d607ebf 100644 --- a/src/data/transparency.ts +++ b/src/data/transparency.ts @@ -18,7 +18,6 @@ export const METRICS = [ { value: '300+', label: 'membros' }, { value: '30+', label: 'mentorados' }, { value: '16+', label: 'colocados em empregos' }, - { value: '2', label: 'colocados em universidades federais' }, ] as const; export type BoardMember = (typeof BOARD_MEMBERS)[number];