@@ -10,14 +10,14 @@ import {
1010 mockLibraryBlockDraftHistory ,
1111 mockLibraryBlockPublishHistory ,
1212 mockLibraryBlockPublishHistoryEntries ,
13- mockLibraryBlockMetadata ,
13+ mockLibraryBlockCreationEntry ,
1414} from '../../data/api.mocks' ;
1515import { HistoryComponentLog } from './HistoryLog' ;
1616
1717mockLibraryBlockDraftHistory . applyMock ( ) ;
1818mockLibraryBlockPublishHistory . applyMock ( ) ;
1919mockLibraryBlockPublishHistoryEntries . applyMock ( ) ;
20- mockLibraryBlockMetadata . applyMock ( ) ;
20+ mockLibraryBlockCreationEntry . applyMock ( ) ;
2121
2222const renderComponent = ( componentId : string ) => render (
2323 < HistoryComponentLog componentId = { componentId } displayName = "Test Component" /> ,
@@ -43,12 +43,12 @@ describe('<HistoryComponentLog />', () => {
4343 } ) ;
4444
4545 it ( 'shows loading spinner while fetching' , ( ) => {
46- renderComponent ( mockLibraryBlockMetadata . usageKeyThatNeverLoads ) ;
46+ renderComponent ( mockLibraryBlockCreationEntry . usageKeyThatNeverLoads ) ;
4747 expect ( screen . getByRole ( 'status' ) ) . toBeInTheDocument ( ) ;
4848 } ) ;
4949
5050 it ( 'renders draft history group with entries when they exist' , async ( ) => {
51- renderComponent ( mockLibraryBlockMetadata . usageKeyNeverPublished ) ;
51+ renderComponent ( mockLibraryBlockCreationEntry . usageKey ) ;
5252 const trigger = await findByTextContent ( / T e s t C o m p o n e n t i s a d r a f t / i) ;
5353 expect ( trigger ) . toBeInTheDocument ( ) ;
5454 fireEvent . click ( trigger ) ;
@@ -57,19 +57,19 @@ describe('<HistoryComponentLog />', () => {
5757 } ) ;
5858
5959 it ( 'does not render draft history group when there are no draft entries' , async ( ) => {
60- renderComponent ( mockLibraryBlockMetadata . usageKeyPublished ) ;
60+ renderComponent ( mockLibraryBlockCreationEntry . usageKeyEmpty ) ;
6161 await waitFor ( ( ) => expect ( screen . queryByRole ( 'status' ) ) . not . toBeInTheDocument ( ) ) ;
6262 expect ( screen . queryByText ( 'Test Component is a draft' ) ) . not . toBeInTheDocument ( ) ;
6363 } ) ;
6464
6565 it ( 'renders publish history group when one exists' , async ( ) => {
66- renderComponent ( mockLibraryBlockMetadata . usageKeyNeverPublished ) ;
66+ renderComponent ( mockLibraryBlockCreationEntry . usageKey ) ;
6767 expect ( await findByTextContent ( / a u t h o r p u b l i s h e d .* P r o t o n s / i) ) . toBeInTheDocument ( ) ;
6868 expect ( await screen . findByText ( / 5 a u t h o r s c o n t r i b u t e d / i) ) . toBeInTheDocument ( ) ;
6969 } ) ;
7070
7171 it ( 'loads and shows publish history entries after expanding the publish group' , async ( ) => {
72- renderComponent ( mockLibraryBlockMetadata . usageKeyNeverPublished ) ;
72+ renderComponent ( mockLibraryBlockCreationEntry . usageKey ) ;
7373 expect ( await screen . findByText ( / 5 a u t h o r s c o n t r i b u t e d / i) ) . toBeInTheDocument ( ) ;
7474 const publishTrigger = await findByTextContent ( / a u t h o r p u b l i s h e d .* P r o t o n s / i) ;
7575
@@ -79,13 +79,13 @@ describe('<HistoryComponentLog />', () => {
7979 } ) ;
8080
8181 it ( 'does not render publish history group when list is empty' , async ( ) => {
82- renderComponent ( mockLibraryBlockMetadata . usageKeyPublished ) ;
82+ renderComponent ( mockLibraryBlockCreationEntry . usageKeyEmpty ) ;
8383 await waitFor ( ( ) => expect ( screen . queryByRole ( 'status' ) ) . not . toBeInTheDocument ( ) ) ;
8484 expect ( screen . queryByText ( / p u b l i s h e d / i) ) . not . toBeInTheDocument ( ) ;
8585 } ) ;
8686
8787 it ( 'always renders the created group with fallback user when createdBy is null' , async ( ) => {
88- renderComponent ( mockLibraryBlockMetadata . usageKeyNeverPublished ) ;
88+ renderComponent ( mockLibraryBlockCreationEntry . usageKey ) ;
8989 expect ( await findByTextContent ( / 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 1 / i) ) . toBeInTheDocument ( ) ;
9090 } ) ;
9191} ) ;
0 commit comments