File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { describe , it , expect } from 'vitest' ;
2+ import { render , screen } from '@testing-library/react' ;
3+ import { Footer } from './Footer' ;
4+
5+ describe ( 'Footer Component' , ( ) => {
6+ it ( 'renders community text' , ( ) => {
7+ render ( < Footer /> ) ;
8+
9+ const text = screen . getByText ( / D e s i g n e d f o r t h e e l i t e b u i l d e r c o m m u n i t y / i) ;
10+
11+ expect ( text ) . toBeTruthy ( ) ;
12+ } ) ;
13+
14+ it ( 'renders Documentation link' , ( ) => {
15+ render ( < Footer /> ) ;
16+
17+ const docLink = screen . getByText ( / D o c u m e n t a t i o n / i) ;
18+
19+ expect ( docLink ) . toBeTruthy ( ) ;
20+
21+ expect ( docLink . closest ( 'a' ) ?. getAttribute ( 'href' ) ) . toBe (
22+ 'https://github.com/JhaSourav07/commitpulse/blob/main/README.md'
23+ ) ;
24+ } ) ;
25+
26+ it ( 'opens documentation in new tab' , ( ) => {
27+ render ( < Footer /> ) ;
28+
29+ const docLink = screen . getByText ( / D o c u m e n t a t i o n / i) ;
30+
31+ expect ( docLink . closest ( 'a' ) ?. getAttribute ( 'target' ) ) . toBe ( '_blank' ) ;
32+ } ) ;
33+
34+ it ( 'renders Contributors link' , ( ) => {
35+ render ( < Footer /> ) ;
36+
37+ const contributorsLink = screen . getByText ( / C o n t r i b u t o r s / i) ;
38+
39+ expect ( contributorsLink ) . toBeTruthy ( ) ;
40+ } ) ;
41+ } ) ;
You can’t perform that action at this time.
0 commit comments