1+ import { render , screen } from "@testing-library/react" ;
2+ import { TechnicalExpertise } from "../TechnicalExpertise" ;
3+
4+ describe ( "TechnicalExpertise" , ( ) => {
5+ describe ( "Section Structure" , ( ) => {
6+ it ( "renders section with correct padding" , ( ) => {
7+ render ( < TechnicalExpertise /> ) ;
8+
9+ const section = screen . getByRole ( "region" , { name : / t e c h n i c a l e x p e r t i s e / i } ) ;
10+ expect ( section ) . toHaveClass ( "py-20" ) ;
11+ } ) ;
12+
13+ it ( "renders container with correct max-width and margins" , ( ) => {
14+ render ( < TechnicalExpertise /> ) ;
15+
16+ const container = screen . getByTestId ( "technical-expertise-container" ) ;
17+ expect ( container ) . toHaveClass ( "max-w-6xl" , "mx-auto" , "px-4" ) ;
18+ } ) ;
19+
20+ it ( "renders with light theme colors" , ( ) => {
21+ render ( < TechnicalExpertise /> ) ;
22+
23+ const section = screen . getByRole ( "region" , { name : / t e c h n i c a l e x p e r t i s e / i } ) ;
24+ expect ( section ) . toHaveClass ( "bg-[#ffffff]" ) ;
25+ } ) ;
26+
27+ it ( "renders with dark theme colors" , ( ) => {
28+ document . documentElement . classList . add ( "dark" ) ;
29+
30+ render ( < TechnicalExpertise /> ) ;
31+
32+ const section = screen . getByRole ( "region" , { name : / t e c h n i c a l e x p e r t i s e / i } ) ;
33+ expect ( section ) . toHaveClass ( "dark:bg-[#0d1117]" ) ;
34+
35+ document . documentElement . classList . remove ( "dark" ) ;
36+ } ) ;
37+ } ) ;
38+
39+ describe ( "Section Heading" , ( ) => {
40+ it ( "renders heading with correct text" , ( ) => {
41+ render ( < TechnicalExpertise /> ) ;
42+
43+ const heading = screen . getByRole ( "heading" , { level : 2 } ) ;
44+ expect ( heading ) . toHaveTextContent ( "Technical Expertise" ) ;
45+ } ) ;
46+
47+ it ( "renders heading with JetBrains Mono font family" , ( ) => {
48+ render ( < TechnicalExpertise /> ) ;
49+
50+ const heading = screen . getByRole ( "heading" , { level : 2 } ) ;
51+ expect ( heading ) . toHaveClass ( "font-mono" ) ;
52+ } ) ;
53+
54+ it ( "renders heading with correct sizes for desktop and mobile" , ( ) => {
55+ render ( < TechnicalExpertise /> ) ;
56+
57+ const heading = screen . getByRole ( "heading" , { level : 2 } ) ;
58+ expect ( heading ) . toHaveClass ( "text-[2rem]" , "md:text-[2.5rem]" ) ;
59+ } ) ;
60+
61+ it ( "renders heading with correct font weight" , ( ) => {
62+ render ( < TechnicalExpertise /> ) ;
63+
64+ const heading = screen . getByRole ( "heading" , { level : 2 } ) ;
65+ expect ( heading ) . toHaveClass ( "font-semibold" ) ;
66+ } ) ;
67+
68+ it ( "renders heading with light theme text color" , ( ) => {
69+ render ( < TechnicalExpertise /> ) ;
70+
71+ const heading = screen . getByRole ( "heading" , { level : 2 } ) ;
72+ expect ( heading ) . toHaveClass ( "text-[#24292f]" ) ;
73+ } ) ;
74+
75+ it ( "renders heading with dark theme text color" , ( ) => {
76+ document . documentElement . classList . add ( "dark" ) ;
77+
78+ render ( < TechnicalExpertise /> ) ;
79+
80+ const heading = screen . getByRole ( "heading" , { level : 2 } ) ;
81+ expect ( heading ) . toHaveClass ( "dark:text-[#f0f6fc]" ) ;
82+
83+ document . documentElement . classList . remove ( "dark" ) ;
84+ } ) ;
85+ } ) ;
86+
87+ describe ( "Category Grid" , ( ) => {
88+ it ( "renders grid container with correct responsive classes" , ( ) => {
89+ render ( < TechnicalExpertise /> ) ;
90+
91+ const grid = screen . getByTestId ( "categories-grid" ) ;
92+ expect ( grid ) . toHaveClass ( "grid" , "grid-cols-1" , "md:grid-cols-2" ) ;
93+ } ) ;
94+
95+ it ( "renders grid with correct gap spacing" , ( ) => {
96+ render ( < TechnicalExpertise /> ) ;
97+
98+ const grid = screen . getByTestId ( "categories-grid" ) ;
99+ expect ( grid ) . toHaveClass ( "gap-8" ) ;
100+ } ) ;
101+
102+ it ( "renders grid with correct margin top from heading" , ( ) => {
103+ render ( < TechnicalExpertise /> ) ;
104+
105+ const grid = screen . getByTestId ( "categories-grid" ) ;
106+ expect ( grid ) . toHaveClass ( "mt-12" ) ;
107+ } ) ;
108+ } ) ;
109+
110+ describe ( "Category Cards" , ( ) => {
111+ it ( "renders all 4 category cards" , ( ) => {
112+ render ( < TechnicalExpertise /> ) ;
113+
114+ const categoryCards = screen . getAllByTestId ( "category-card" ) ;
115+ expect ( categoryCards ) . toHaveLength ( 4 ) ;
116+ } ) ;
117+
118+ it ( "renders Frontend Development category" , ( ) => {
119+ render ( < TechnicalExpertise /> ) ;
120+
121+ expect ( screen . getByText ( "Frontend Development" ) ) . toBeInTheDocument ( ) ;
122+ } ) ;
123+
124+ it ( "renders Backend Development category" , ( ) => {
125+ render ( < TechnicalExpertise /> ) ;
126+
127+ expect ( screen . getByText ( "Backend Development" ) ) . toBeInTheDocument ( ) ;
128+ } ) ;
129+
130+ it ( "renders Mobile Development category" , ( ) => {
131+ render ( < TechnicalExpertise /> ) ;
132+
133+ expect ( screen . getByText ( "Mobile Development" ) ) . toBeInTheDocument ( ) ;
134+ } ) ;
135+
136+ it ( "renders DevOps & Tools category" , ( ) => {
137+ render ( < TechnicalExpertise /> ) ;
138+
139+ expect ( screen . getByText ( "DevOps & Tools" ) ) . toBeInTheDocument ( ) ;
140+ } ) ;
141+
142+ it ( "renders category cards with correct background colors" , ( ) => {
143+ render ( < TechnicalExpertise /> ) ;
144+
145+ const categoryCards = screen . getAllByTestId ( "category-card" ) ;
146+ categoryCards . forEach ( card => {
147+ expect ( card ) . toHaveClass ( "bg-[#f6f8fa]" ) ;
148+ } ) ;
149+ } ) ;
150+
151+ it ( "renders category cards with dark theme background colors" , ( ) => {
152+ document . documentElement . classList . add ( "dark" ) ;
153+
154+ render ( < TechnicalExpertise /> ) ;
155+
156+ const categoryCards = screen . getAllByTestId ( "category-card" ) ;
157+ categoryCards . forEach ( card => {
158+ expect ( card ) . toHaveClass ( "dark:bg-[#21262d]" ) ;
159+ } ) ;
160+
161+ document . documentElement . classList . remove ( "dark" ) ;
162+ } ) ;
163+
164+ it ( "renders category cards with correct border styling" , ( ) => {
165+ render ( < TechnicalExpertise /> ) ;
166+
167+ const categoryCards = screen . getAllByTestId ( "category-card" ) ;
168+ categoryCards . forEach ( card => {
169+ expect ( card ) . toHaveClass ( "border" , "border-muted/20" , "rounded-lg" ) ;
170+ } ) ;
171+ } ) ;
172+
173+ it ( "renders category cards with correct padding" , ( ) => {
174+ render ( < TechnicalExpertise /> ) ;
175+
176+ const categoryCards = screen . getAllByTestId ( "category-card" ) ;
177+ categoryCards . forEach ( card => {
178+ expect ( card ) . toHaveClass ( "p-6" ) ;
179+ } ) ;
180+ } ) ;
181+
182+ it ( "renders category cards with hover effects" , ( ) => {
183+ render ( < TechnicalExpertise /> ) ;
184+
185+ const categoryCards = screen . getAllByTestId ( "category-card" ) ;
186+ categoryCards . forEach ( card => {
187+ expect ( card ) . toHaveClass ( "hover:shadow-lg" , "transition-all" , "duration-300" ) ;
188+ } ) ;
189+ } ) ;
190+ } ) ;
191+
192+ describe ( "Responsive Design" , ( ) => {
193+ it ( "has mobile-first responsive grid classes" , ( ) => {
194+ render ( < TechnicalExpertise /> ) ;
195+
196+ const grid = screen . getByTestId ( "categories-grid" ) ;
197+ // Should start with 1 column on mobile
198+ expect ( grid ) . toHaveClass ( "grid-cols-1" ) ;
199+ // Then 2 columns on medium screens
200+ expect ( grid ) . toHaveClass ( "md:grid-cols-2" ) ;
201+ } ) ;
202+ } ) ;
203+ } ) ;
0 commit comments