@@ -6,7 +6,7 @@ import FileEntry from './FileEntry'
66
77import { displayTypeParameter } from '../../constants'
88
9- const wrapper = ( { children } ) => (
9+ const wrapper : React . FC < React . PropsWithChildren > = ( { children } ) => (
1010 < MemoryRouter initialEntries = { [ '/gh/codecov/test-repo' ] } >
1111 < Route path = "/:provider/:owner/:repo/" > { children } </ Route >
1212 </ MemoryRouter >
@@ -15,15 +15,13 @@ const wrapper = ({ children }) => (
1515describe ( 'FileEntry' , ( ) => {
1616 describe ( 'checking properties on list display' , ( ) => {
1717 it ( 'displays the file path' , ( ) => {
18- const runPrefetchMock = vi . fn ( )
1918 render (
2019 < FileEntry
2120 linkRef = "main"
2221 path = "dir/file.js"
2322 name = "file.js"
2423 urlPath = "dir"
2524 displayType = { displayTypeParameter . list }
26- runPrefetch = { runPrefetchMock }
2725 /> ,
2826 { wrapper }
2927 )
@@ -34,15 +32,13 @@ describe('FileEntry', () => {
3432
3533 describe ( 'checking properties on tree display' , ( ) => {
3634 it ( 'displays the file name' , ( ) => {
37- const runPrefetchMock = vi . fn ( )
3835 render (
3936 < FileEntry
4037 linkRef = "main"
4138 path = "dir/file.js"
4239 name = "file.js"
4340 urlPath = "dir"
4441 displayType = { displayTypeParameter . tree }
45- runPrefetch = { runPrefetchMock }
4642 /> ,
4743 { wrapper }
4844 )
@@ -51,15 +47,13 @@ describe('FileEntry', () => {
5147 } )
5248
5349 it ( 'does not display the file name' , ( ) => {
54- const runPrefetchMock = vi . fn ( )
5550 render (
5651 < FileEntry
5752 linkRef = "main"
5853 path = "dir/file.js"
5954 name = "file.js"
6055 urlPath = "dir"
6156 displayType = { displayTypeParameter . tree }
62- runPrefetch = { runPrefetchMock }
6357 /> ,
6458 { wrapper }
6559 )
@@ -70,15 +64,13 @@ describe('FileEntry', () => {
7064
7165 describe ( 'is displaying a list' , ( ) => {
7266 it ( 'displays the file path label' , ( ) => {
73- const runPrefetchMock = vi . fn ( )
7467 render (
7568 < FileEntry
7669 linkRef = "main"
7770 path = "dir/file.js"
7871 name = "file.js"
7972 urlPath = "dir"
8073 displayType = { displayTypeParameter . list }
81- runPrefetch = { runPrefetchMock }
8274 /> ,
8375 { wrapper }
8476 )
@@ -110,7 +102,6 @@ describe('FileEntry', () => {
110102 } )
111103
112104 describe ( 'passed pageName commit props' , ( ) => {
113- const runPrefetchMock = vi . fn ( )
114105 it ( 'sets the correct href' , ( ) => {
115106 render (
116107 < FileEntry
@@ -119,7 +110,6 @@ describe('FileEntry', () => {
119110 urlPath = "dir"
120111 commitSha = "coolCommitSha"
121112 displayType = { displayTypeParameter . tree }
122- runPrefetch = { runPrefetchMock }
123113 pageName = "commitFileDiff"
124114 /> ,
125115 { wrapper }
@@ -135,15 +125,13 @@ describe('FileEntry', () => {
135125
136126 describe ( 'passed queryParams prop' , ( ) => {
137127 it ( 'sets the correct href' , ( ) => {
138- const runPrefetchMock = vi . fn ( )
139128 render (
140129 < FileEntry
141130 linkRef = "main"
142131 path = "dir/file.js"
143132 name = "file.js"
144133 urlPath = "dir"
145134 displayType = { displayTypeParameter . list }
146- runPrefetch = { runPrefetchMock }
147135 queryParams = { { flags : [ 'flag-1' ] } }
148136 /> ,
149137 { wrapper }
0 commit comments