@@ -84,13 +84,14 @@ export const Sidebar = ({
8484
8585 return (
8686 < motion . aside
87+ data-testid = "sidebar"
8788 className = { sidebarContainer }
8889 initial = "open"
8990 animate = { isSidebarOpen ? "open" : "closed" }
9091 variants = { sidebarVariants }
9192 { ...sidebarOnBoardingProps }
9293 >
93- < div className = { sidebarToggleButton } onClick = { toggleSidebar } >
94+ < div data-testid = "sidebarToggle" className = { sidebarToggleButton } onClick = { toggleSidebar } >
9495 { isSidebarOpen ? "«" : "»" }
9596 </ div >
9697 < motion . div variants = { contentVariants } >
@@ -100,7 +101,7 @@ export const Sidebar = ({
100101 { pages . length === 0 ? (
101102 < div className = { placeholderMessage } > + 버튼을 눌러 페이지를 추가하세요</ div >
102103 ) : (
103- pages ?. map ( ( item ) => (
104+ pages ?. map ( ( item , idx ) => (
104105 < motion . div
105106 key = { item . id }
106107 initial = { animation . initial }
@@ -109,6 +110,7 @@ export const Sidebar = ({
109110 >
110111 < PageItem
111112 { ...item }
113+ testKey = { `pageItem-${ idx } ` }
112114 onClick = { ( ) => handlePageItemClick ( item . id ) }
113115 onDelete = { ( ) => confirmPageDelete ( item ) }
114116 handleIconUpdate = { handlePageUpdate }
@@ -118,7 +120,12 @@ export const Sidebar = ({
118120 ) }
119121 </ motion . nav >
120122 < motion . div className = { plusIconBox } variants = { contentVariants } >
121- < IconButton icon = "plus" onClick = { handleAddPageButtonClick } size = "sm" />
123+ < IconButton
124+ testKey = "addPageButton"
125+ icon = "plus"
126+ onClick = { handleAddPageButtonClick }
127+ size = "sm"
128+ />
122129 < AuthButton />
123130 </ motion . div >
124131
0 commit comments