From adc7ed430d85a3633e2bfc595fcc3d881411e717 Mon Sep 17 00:00:00 2001 From: Benevanio Santos Date: Sun, 7 Jun 2026 18:54:49 -0300 Subject: [PATCH 1/2] =?UTF-8?q?feat(tests):=20corre=C3=A7=C3=A3o=20de=20co?= =?UTF-8?q?ntribuidores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/landing/TeamSection.tsx | 101 +++++++++++++----- .../components/landing/TeamSection.test.tsx | 12 ++- 2 files changed, 81 insertions(+), 32 deletions(-) diff --git a/frontend/src/components/landing/TeamSection.tsx b/frontend/src/components/landing/TeamSection.tsx index 90e80e33..8ee366e2 100644 --- a/frontend/src/components/landing/TeamSection.tsx +++ b/frontend/src/components/landing/TeamSection.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from 'react'; +import { Autoplay, Pagination } from 'swiper/modules'; import { Swiper, SwiperSlide } from 'swiper/react'; -import { Pagination, Autoplay } from 'swiper/modules'; +import { Github } from 'lucide-react'; import 'swiper/css'; import 'swiper/css/pagination'; -import { Github } from 'lucide-react'; interface Contributor { id: number; @@ -31,6 +31,14 @@ const INITIAL_TEAM: Contributor[] = [ html_url: "https://github.com/PedroLucas1337", contributions: 0, type: "User" + }, + { + id: 110640572, + login: "thalitat", + avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4", + html_url: "https://github.com/thalitat", + contributions: 0, + type: "User" } ]; @@ -51,31 +59,59 @@ export default function TeamSection() { return res.json(); }) .then((data: unknown) => { - if (Array.isArray(data)) { - let realUsers = (data as Contributor[]) - .filter(user => user.type === 'User') - .map(user => { - if (user.login.toLowerCase() === "pedrolucas1337") { - return { ...user, avatar_url: "https://github.com/PedroLucas1337.png" }; - } - return user; - }); - - const hasPedro = realUsers.some(user => user.login.toLowerCase() === "pedrolucas1337"); - - if (!hasPedro) { - const pedroObj: Contributor = { - id: 104951475, - login: "PedroLucas1337", - avatar_url: "https://github.com/PedroLucas1337.png", - html_url: "https://github.com/PedroLucas1337", - contributions: 0, - type: "User" - }; - realUsers = [...realUsers, pedroObj]; + if (!Array.isArray(data)) return; + + const realUsers = (data as Contributor[]) + .filter(user => user.type === 'User') + .map(user => { + if (user.login.toLowerCase() === "pedrolucas1337") { + return { + ...user, + avatar_url: "https://github.com/PedroLucas1337.png" + }; + } + + if (user.login.toLowerCase() === "thalitat") { + return { + ...user, + avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4" + }; + } + + return user; + }); + + const fixedMembers: Contributor[] = [ + { + id: 104951475, + login: "PedroLucas1337", + avatar_url: "https://github.com/PedroLucas1337.png", + html_url: "https://github.com/PedroLucas1337", + contributions: 0, + type: "User" + }, + { + id: 110640572, + login: "thalitat", + avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4", + html_url: "https://github.com/thalitat", + contributions: 0, + type: "User" + } + ]; + + fixedMembers.forEach(member => { + const exists = realUsers.some( + user => user.login.toLowerCase() === member.login.toLowerCase() + ); + + if (!exists) { + realUsers.push(member); } + }); - if (realUsers.length > 0) setContributors(realUsers); + if (realUsers.length > 0) { + setContributors(realUsers); } }) .catch((err) => { @@ -92,7 +128,7 @@ export default function TeamSection() {
Conheça as mentes brilhantes por trás do{" "} - + < Cand!Date! > @@ -122,22 +158,29 @@ export default function TeamSection() { {contributors.map((user) => (
+
{user.login} +

{user.login}

- {user.login.toLowerCase() === "pedrolucas1337" + {user.login.toLowerCase() === "benevanio" + ? "Founder & Backend Dev" + : user.login.toLowerCase() === "pedrolucas1337" ? "QA" + : user.login.toLowerCase() === "thalitat" + ? "UX/UI Designer" : `${user.contributions} ${user.contributions === 1 ? 'commit' : 'commits'}`}

+ Ver Perfil - +
@@ -164,4 +207,4 @@ export default function TeamSection() { `} ); -} +} \ No newline at end of file diff --git a/frontend/tests/unit/components/landing/TeamSection.test.tsx b/frontend/tests/unit/components/landing/TeamSection.test.tsx index e4cfd3d1..a9cd7e64 100644 --- a/frontend/tests/unit/components/landing/TeamSection.test.tsx +++ b/frontend/tests/unit/components/landing/TeamSection.test.tsx @@ -19,7 +19,7 @@ describe("TeamSection", () => { vi.restoreAllMocks(); }); - it("renderiza lista da API, filtra bots e garante presença do Pedro", async () => { + it("renderiza lista da API, filtra bots e garante presença de membros fixos", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValue({ ok: true, json: async () => [ @@ -49,9 +49,13 @@ describe("TeamSection", () => { }); expect(screen.queryByText("bot-user")).not.toBeInTheDocument(); + + // membros fixos expect(screen.getByText("PedroLucas1337")).toBeInTheDocument(); + expect(screen.getByText("thalitat")).toBeInTheDocument(); + expect(screen.getByText("QA")).toBeInTheDocument(); - expect(screen.getByText("1 commit")).toBeInTheDocument(); + expect(screen.getByText("UX/UI Designer")).toBeInTheDocument(); }); it("mantém fallback local quando API retorna resposta inválida", async () => { @@ -117,6 +121,7 @@ describe("TeamSection", () => { await waitFor(() => { expect(screen.getByText("Benevanio")).toBeInTheDocument(); expect(screen.getByText("PedroLucas1337")).toBeInTheDocument(); + expect(screen.getByText("thalitat")).toBeInTheDocument(); }); }); @@ -175,6 +180,7 @@ describe("TeamSection", () => { await waitFor(() => { expect(screen.getByText("Benevanio")).toBeInTheDocument(); expect(screen.getByText("PedroLucas1337")).toBeInTheDocument(); + expect(screen.getByText("thalitat")).toBeInTheDocument(); }); }); -}); +}); \ No newline at end of file From 8392d4fb28c6b219b22d064e96f45322f1799721 Mon Sep 17 00:00:00 2001 From: Benevanio Santos Date: Sun, 7 Jun 2026 19:31:12 -0300 Subject: [PATCH 2/2] feat: adicionando o Jeremias como colaborador --- .../src/components/landing/TeamSection.tsx | 70 +++++++++++++++---- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/landing/TeamSection.tsx b/frontend/src/components/landing/TeamSection.tsx index 8ee366e2..eaaa67c6 100644 --- a/frontend/src/components/landing/TeamSection.tsx +++ b/frontend/src/components/landing/TeamSection.tsx @@ -39,6 +39,14 @@ const INITIAL_TEAM: Contributor[] = [ html_url: "https://github.com/thalitat", contributions: 0, type: "User" + }, + { + id: 999999998, + login: "jeremiassnts", + avatar_url: "https://github.com/jeremiassnts.png", + html_url: "https://github.com/jeremiassnts", + contributions: 0, + type: "User" } ]; @@ -51,7 +59,7 @@ export default function TeamSection() { useEffect(() => { fetch(`https://api.github.com/repos/${OWNER}/${REPO}/contributors`, { headers: { - 'Accept': 'application/vnd.github.v3+json', + Accept: 'application/vnd.github.v3+json', } }) .then((res) => { @@ -64,20 +72,29 @@ export default function TeamSection() { const realUsers = (data as Contributor[]) .filter(user => user.type === 'User') .map(user => { - if (user.login.toLowerCase() === "pedrolucas1337") { + const login = user.login.toLowerCase(); + + if (login === "pedrolucas1337") { return { ...user, avatar_url: "https://github.com/PedroLucas1337.png" }; } - if (user.login.toLowerCase() === "thalitat") { + if (login === "thalitat") { return { ...user, avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4" }; } + if (login === "jeremiassnts") { + return { + ...user, + avatar_url: "https://github.com/jeremiassnts.png" + }; + } + return user; }); @@ -97,6 +114,14 @@ export default function TeamSection() { html_url: "https://github.com/thalitat", contributions: 0, type: "User" + }, + { + id: 999999998, + login: "jeremiassnts", + avatar_url: "https://github.com/jeremiassnts.png", + html_url: "https://github.com/jeremiassnts", + contributions: 0, + type: "User" } ]; @@ -110,27 +135,45 @@ export default function TeamSection() { } }); - if (realUsers.length > 0) { - setContributors(realUsers); - } + const merged = [...INITIAL_TEAM, ...realUsers]; + + const unique = merged.filter( + (user, index, self) => + index === self.findIndex( + u => u.login.toLowerCase() === user.login.toLowerCase() + ) + ); + + setContributors(unique); }) .catch((err) => { - console.warn("GitHub API offline ou limitada. Mantendo lista local:", err.message); + console.warn( + "GitHub API offline ou limitada. Mantendo lista local:", + err.message + ); }); }, []); return ( -
+

- Nosso Time de Contribuidores + Nosso{" "} + + Time + {" "} + de Contribuidores

Conheça as mentes brilhantes por trás do{" "} - + < - Cand!Date! + Cand!Date + ! >
@@ -158,7 +201,6 @@ export default function TeamSection() { {contributors.map((user) => (
-
@@ -188,7 +232,7 @@ export default function TeamSection() { className="w-full py-2 px-4 bg-gradient-to-r from-blue-600 via-indigo-600 to-violet-600 hover:opacity-90 text-white flex items-center justify-center text-sm font-medium rounded-lg transition-all duration-200 gap-2 shadow-sm" > Ver Perfil - +