Skip to content

Commit f554450

Browse files
Convert BranchFileEntry to ts and make path non-nullable
1 parent 822d109 commit f554450

File tree

14 files changed

+136
-196
lines changed

14 files changed

+136
-196
lines changed

src/pages/CommitDetailPage/CommitCoverage/routes/CommitDetailFileExplorer/hooks/useRepoCommitContentsTable.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const mockCommitContentData = {
2222
results: [
2323
{
2424
name: 'src',
25-
path: null,
25+
path: 'src',
2626
percentCovered: 50.0,
2727
hits: 24,
2828
misses: 24,
@@ -34,7 +34,7 @@ const mockCommitContentData = {
3434
},
3535
{
3636
name: 'file.ts',
37-
path: null,
37+
path: 'file.ts',
3838
percentCovered: 50.0,
3939
hits: 24,
4040
misses: 24,

src/services/pathContents/branch/dir/usePrefetchBranchDirEntry.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const mockData = {
2626
node: {
2727
__typename: 'PathContentDir',
2828
name: 'src',
29-
path: null,
29+
path: 'src',
3030
percentCovered: 0.0,
3131
hits: 4,
3232
misses: 2,
@@ -214,7 +214,7 @@ describe('usePrefetchBranchDirEntry', () => {
214214
{
215215
__typename: 'PathContentDir',
216216
name: 'src',
217-
path: null,
217+
path: 'src',
218218
percentCovered: 0,
219219
hits: 4,
220220
misses: 2,

src/services/pathContents/branch/dir/usePrefetchBranchDirEntry.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const BasePathContentSchema = z.object({
2121
partials: z.number(),
2222
lines: z.number(),
2323
name: z.string(),
24-
path: z.string().nullable(),
24+
path: z.string(),
2525
percentCovered: z.number(),
2626
})
2727

src/services/pathContents/branch/dir/useRepoBranchContents.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const BasePathContentSchema = z.object({
2121
partials: z.number(),
2222
lines: z.number(),
2323
name: z.string(),
24-
path: z.string().nullable(),
24+
path: z.string(),
2525
percentCovered: z.number(),
2626
})
2727

src/services/pathContents/commit/dir/usePrefetchCommitDirEntry.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const mockData = {
4343
results: [
4444
{
4545
name: 'src',
46-
path: null,
46+
path: 'src',
4747
__typename: 'PathContentDir',
4848
hits: 4,
4949
misses: 2,
@@ -190,7 +190,7 @@ describe('usePrefetchCommitDirEntry', () => {
190190
{
191191
__typename: 'PathContentDir',
192192
name: 'src',
193-
path: null,
193+
path: 'src',
194194
percentCovered: 50.0,
195195
hits: 4,
196196
misses: 2,

src/services/pathContents/commit/dir/useRepoCommitContents.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const mockData = {
2727
results: [
2828
{
2929
name: 'file.ts',
30-
path: null,
30+
path: 'file.ts',
3131
__typename: 'PathContentFile',
3232
hits: 24,
3333
misses: 24,
@@ -206,7 +206,7 @@ describe('useRepoCommitContents', () => {
206206
hits: 24,
207207
lines: 22,
208208
misses: 24,
209-
path: null,
209+
path: 'file.ts',
210210
partials: 22,
211211
},
212212
],

src/services/pathContents/pull/dir/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const RepositoryConfigSchema = z.object({
2525
const PathContentFileSchema = z.object({
2626
__typename: z.literal('PathContentFile'),
2727
name: z.string(),
28-
path: z.string().nullable(),
28+
path: z.string(),
2929
hits: z.number(),
3030
misses: z.number(),
3131
partials: z.number(),
@@ -38,7 +38,7 @@ export type PathContentFile = z.infer<typeof PathContentFileSchema>
3838
const PathContentDirSchema = z.object({
3939
__typename: z.literal('PathContentDir'),
4040
name: z.string(),
41-
path: z.string().nullable(),
41+
path: z.string(),
4242
hits: z.number(),
4343
misses: z.number(),
4444
partials: z.number(),

src/services/pathContents/pull/dir/usePrefetchPullDirEntry.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const mockData = {
6161
{
6262
__typename: 'PathContentDir',
6363
name: 'src',
64-
path: null,
64+
path: 'src',
6565
hits: 4,
6666
misses: 2,
6767
partials: 1,
@@ -147,7 +147,7 @@ describe('usePrefetchPullDirEntry', () => {
147147
{
148148
__typename: 'PathContentDir',
149149
name: 'src',
150-
path: null,
150+
path: 'src',
151151
percentCovered: 40.0,
152152
hits: 4,
153153
misses: 2,

src/shared/ContentsTable/TableEntries/BranchEntries/BranchDirEntry.test.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const mockData = {
2727
node: {
2828
__typename: 'PathContentDir',
2929
name: 'src',
30-
path: null,
30+
path: 'src',
3131
percentCovered: 0.0,
3232
hits: 4,
3333
misses: 2,
@@ -191,7 +191,7 @@ describe('BranchDirEntry', () => {
191191
misses: 2,
192192
name: 'src',
193193
partials: 1,
194-
path: null,
194+
path: 'src',
195195
percentCovered: 0,
196196
},
197197
],

src/shared/ContentsTable/TableEntries/BranchEntries/BranchFileEntry.jsx

-51
This file was deleted.

0 commit comments

Comments
 (0)