@@ -136,6 +136,33 @@ describe('<HistoryComponentLog />', () => {
136136 mockLibraryBlockPublishHistory . data = originalData ;
137137 } ) ;
138138
139+ it ( 'renders draft entry with "created" action' , async ( ) => {
140+ const user = userEvent . setup ( ) ;
141+ const originalData = mockLibraryBlockDraftHistory . data ;
142+ mockLibraryBlockDraftHistory . data = [
143+ {
144+ changedBy : {
145+ username : 'creator_user' ,
146+ profileImageUrls : {
147+ full : 'icon/mock/path' ,
148+ large : 'icon/mock/path' ,
149+ medium : 'icon/mock/path' ,
150+ small : 'icon/mock/path' ,
151+ } ,
152+ } ,
153+ changedAt : '2026-03-16T11:00:00Z' ,
154+ title : 'New Component' ,
155+ itemType : 'html' ,
156+ action : 'created' ,
157+ } ,
158+ ] as any ;
159+ renderComponent ( mockLibraryBlockCreationEntry . usageKey ) ;
160+ const trigger = await findByDeepTextContent ( / I n t r o d u c t i o n t o T e s t i n g 1 i s a d r a f t / i) ;
161+ await user . click ( trigger ) ;
162+ expect ( await findByDeepTextContent ( / c r e a t o r _ u s e r c r e a t e d .* N e w C o m p o n e n t / i) ) . toBeInTheDocument ( ) ;
163+ mockLibraryBlockDraftHistory . data = originalData ;
164+ } ) ;
165+
139166 it ( 'renders publish group without collapsible and without contributor count when contributors is empty' , async ( ) => {
140167 const originalData = mockLibraryBlockPublishHistory . data ;
141168 mockLibraryBlockPublishHistory . data = [
@@ -192,6 +219,33 @@ describe('<HistoryContainerLog />', () => {
192219 expect ( screen . queryByText ( / p u b l i s h e d / i) ) . not . toBeInTheDocument ( ) ;
193220 } ) ;
194221
222+ it ( 'renders draft entry with "created" action' , async ( ) => {
223+ const user = userEvent . setup ( ) ;
224+ const originalData = mockLibraryContainerDraftHistory . data ;
225+ mockLibraryContainerDraftHistory . data = [
226+ {
227+ changedBy : {
228+ username : 'creator_user' ,
229+ profileImageUrls : {
230+ full : 'icon/mock/path' ,
231+ large : 'icon/mock/path' ,
232+ medium : 'icon/mock/path' ,
233+ small : 'icon/mock/path' ,
234+ } ,
235+ } ,
236+ changedAt : '2026-03-16T11:00:00Z' ,
237+ title : 'New Unit' ,
238+ itemType : 'unit' ,
239+ action : 'created' ,
240+ } ,
241+ ] as any ;
242+ renderContainerComponent ( mockLibraryContainerDraftHistory . containerKey ) ;
243+ const trigger = await findByDeepTextContent ( / T e s t U n i t i s a d r a f t / i) ;
244+ await user . click ( trigger ) ;
245+ expect ( await findByDeepTextContent ( / c r e a t o r _ u s e r c r e a t e d .* N e w U n i t / i) ) . toBeInTheDocument ( ) ;
246+ mockLibraryContainerDraftHistory . data = originalData ;
247+ } ) ;
248+
195249 it ( 'always renders the created group' , async ( ) => {
196250 renderContainerComponent ( mockLibraryContainerDraftHistory . containerKey ) ;
197251 expect ( await findByDeepTextContent ( / a u t h o r c r e a t e d .* I n t r o d u c t i o n t o T e s t i n g U n i t 1 / i) ) . toBeInTheDocument ( ) ;
0 commit comments