File tree 2 files changed +6
-2
lines changed
src/app/(main)/my-voyage/[teamId]/features/components
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const sharedConfig = {
13
13
coveragePathIgnorePatterns : [ "<rootDir>/build/" , "<rootDir>/node_modules/" ] ,
14
14
moduleNameMapper : {
15
15
"^@/(.*)$" : "<rootDir>/src/$1" ,
16
+ "^@chingu-x/components/(.*)$" : "<rootDir>/node_modules/@chingu-x/components/dist/$1" ,
16
17
} ,
17
18
} ;
18
19
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ jest.mock("@hello-pangea/dnd", () => ({
48
48
</ div >
49
49
) ,
50
50
} ) ) ;
51
+ jest . mock ( "@chingu-x/components/avatar" , ( ) => ( {
52
+ Avatar : jest . fn ( ( ) => < div > Mocked Avatar</ div > ) ,
53
+ } ) ) ;
51
54
52
55
// "current user" id is 25b7b76c-1567-4910-9d50-e78819daccf1
53
56
const renderWithStore = ( feature : Feature , userId : string ) => {
@@ -76,7 +79,7 @@ describe("Feature Card component", () => {
76
79
) ;
77
80
78
81
const cardAction = card . getByRole ( "button" , { name : / f e a t u r e m e n u / i } ) ;
79
- const avatar = card . queryByRole ( "img" , { name : / a v a t a r / i } ) ;
82
+ const avatar = card . queryByText ( "Mocked Avatar" ) ;
80
83
81
84
expect ( cardAction ) . toBeInTheDocument ( ) ;
82
85
expect ( avatar ) . not . toBeInTheDocument ( ) ;
@@ -89,7 +92,7 @@ describe("Feature Card component", () => {
89
92
) ;
90
93
91
94
const cardAction = card . queryByRole ( "button" , { name : / f e a t u r e m e n u / i } ) ;
92
- const avatar = card . getByRole ( "img" , { name : / a v a t a r / i } ) ;
95
+ const avatar = card . queryByText ( "Mocked Avatar" ) ;
93
96
94
97
expect ( cardAction ) . not . toBeInTheDocument ( ) ;
95
98
expect ( avatar ) . toBeInTheDocument ( ) ;
You can’t perform that action at this time.
0 commit comments