@@ -7,7 +7,7 @@ import { UseQueryResult } from 'react-query';
77import { AuthenticatedUser , WorkPackage } from 'shared' ;
88import { render , screen , routerWrapperBuilder , act , fireEvent } from '../../test-support/test-utils' ;
99import { Auth } from '../../../utils/types' ;
10- import { useManyWorkPackages , useSingleWorkPackage } from '../../../hooks/work-packages.hooks' ;
10+ import { useGetBlockingWorkPackages , useSingleWorkPackage } from '../../../hooks/work-packages.hooks' ;
1111import { useAuth } from '../../../hooks/auth.hooks' ;
1212import { mockAuth , mockUseQueryResult } from '../../test-support/test-data/test-utils.stub' ;
1313import { exampleDesignWorkPackage , exampleResearchWorkPackage } from '../../test-support/test-data/work-packages.stub' ;
@@ -25,10 +25,10 @@ const mockSingleWPHook = (isLoading: boolean, isError: boolean, data?: WorkPacka
2525 mockedUseSingleWorkPackage . mockReturnValue ( mockUseQueryResult < WorkPackage > ( isLoading , isError , data , error ) ) ;
2626} ;
2727
28- const mockedUseManyWorkPackages = useManyWorkPackages as jest . Mock < UseQueryResult < WorkPackage [ ] > > ;
28+ const mockedGetBlockingWorkPackages = useGetBlockingWorkPackages as jest . Mock < UseQueryResult < WorkPackage [ ] > > ;
2929
30- const mockManyWorkPackagesHook = ( isLoading : boolean , isError : boolean , data ?: WorkPackage [ ] , error ?: Error ) => {
31- mockedUseManyWorkPackages . mockReturnValue ( mockUseQueryResult < WorkPackage [ ] > ( isLoading , isError , data , error ) ) ;
30+ const mockGetBlockingWorkPackagesHook = ( isLoading : boolean , isError : boolean , data ?: WorkPackage [ ] , error ?: Error ) => {
31+ mockedGetBlockingWorkPackages . mockReturnValue ( mockUseQueryResult < WorkPackage [ ] > ( isLoading , isError , data , error ) ) ;
3232} ;
3333
3434vi . mock ( '../../../hooks/auth.hooks' ) ;
@@ -63,7 +63,7 @@ describe('work package container', () => {
6363 mockSingleWPHook ( true , false ) ;
6464 mockAuthHook ( ) ;
6565 mockCurrentUserHook ( ) ;
66- mockManyWorkPackagesHook ( true , false ) ;
66+ mockGetBlockingWorkPackagesHook ( true , false ) ;
6767 renderComponent ( ) ;
6868
6969 expect ( screen . queryByText ( 'Loading...' ) ) . not . toBeInTheDocument ( ) ;
@@ -74,7 +74,7 @@ describe('work package container', () => {
7474 mockSingleWPHook ( false , false , exampleResearchWorkPackage ) ;
7575 mockAuthHook ( ) ;
7676 mockCurrentUserHook ( ) ;
77- mockManyWorkPackagesHook ( false , false , [ exampleDesignWorkPackage ] ) ;
77+ mockGetBlockingWorkPackagesHook ( false , false , [ exampleDesignWorkPackage ] ) ;
7878 renderComponent ( ) ;
7979
8080 expect ( screen . queryByText ( 'Loading...' ) ) . not . toBeInTheDocument ( ) ;
@@ -87,7 +87,7 @@ describe('work package container', () => {
8787 mockSingleWPHook ( false , true , undefined , new Error ( '404 could not find the requested work package' ) ) ;
8888 mockAuthHook ( ) ;
8989 mockCurrentUserHook ( ) ;
90- mockManyWorkPackagesHook ( false , false ) ;
90+ mockGetBlockingWorkPackagesHook ( false , false ) ;
9191 renderComponent ( ) ;
9292
9393 expect ( screen . queryByText ( 'Loading...' ) ) . not . toBeInTheDocument ( ) ;
@@ -99,7 +99,7 @@ describe('work package container', () => {
9999 mockSingleWPHook ( false , true ) ;
100100 mockAuthHook ( ) ;
101101 mockCurrentUserHook ( ) ;
102- mockManyWorkPackagesHook ( false , false ) ;
102+ mockGetBlockingWorkPackagesHook ( false , false ) ;
103103 renderComponent ( ) ;
104104
105105 expect ( screen . queryByText ( 'Loading...' ) ) . not . toBeInTheDocument ( ) ;
@@ -111,7 +111,7 @@ describe('work package container', () => {
111111 mockSingleWPHook ( false , false , exampleResearchWorkPackage ) ;
112112 mockAuthHook ( exampleAdminUser ) ;
113113 mockCurrentUserHook ( ) ;
114- mockManyWorkPackagesHook ( false , false , [ exampleDesignWorkPackage ] ) ;
114+ mockGetBlockingWorkPackagesHook ( false , false , [ exampleDesignWorkPackage ] ) ;
115115 renderComponent ( ) ;
116116
117117 act ( ( ) => {
@@ -124,7 +124,7 @@ describe('work package container', () => {
124124 mockSingleWPHook ( false , false , exampleResearchWorkPackage ) ;
125125 mockAuthHook ( exampleGuestUser ) ;
126126 mockCurrentUserHook ( exampleGuestUser ) ;
127- mockManyWorkPackagesHook ( false , false , [ exampleDesignWorkPackage ] ) ;
127+ mockGetBlockingWorkPackagesHook ( false , false , [ exampleDesignWorkPackage ] ) ;
128128 renderComponent ( ) ;
129129
130130 act ( ( ) => {
0 commit comments