Skip to content

Commit

Permalink
remove status 200
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Sep 19, 2024
1 parent eb35069 commit d064eb2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/layouts/Header/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('Header', () => {
mockedUseFlags.mockReturnValue({ darkMode: false })
server.use(
graphql.query('CurrentUser', (info) => {
return HttpResponse.json({ data: user }, { status: 200 })
return HttpResponse.json({ data: user })
})
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Header/components/AdminLink/AdminLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('AdminLink', () => {
function setup(data = {}) {
server.use(
http.get('/internal/users/current', (info) => {
return HttpResponse.json(data, { status: 200 })
return HttpResponse.json(data)
})
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('MyContextSwitcher', () => {
server.use(
graphql.query('MyContexts', (info) => {
if (noData) {
return HttpResponse.json({ data: { me: null } }, { status: 200 })
return HttpResponse.json({ data: { me: null } })
}

const orgList = !!info.variables?.after ? org2 : org1
Expand All @@ -104,11 +104,11 @@ describe('MyContextSwitcher', () => {
},
}

return HttpResponse.json({ data: queryData }, { status: 200 })
return HttpResponse.json({ data: queryData })
}),
graphql.query('DetailOwner', (info) => {
if (noData) {
return HttpResponse.json({ data: { me: null } }, { status: 200 })
return HttpResponse.json({ data: { me: null } })
}

const queryData = {
Expand All @@ -117,7 +117,7 @@ describe('MyContextSwitcher', () => {
avatarUrl: 'http://127.0.0.1/avatar-url',
},
}
return HttpResponse.json({ data: queryData }, { status: 200 })
return HttpResponse.json({ data: queryData })
})
)

Expand Down
11 changes: 4 additions & 7 deletions src/layouts/Header/components/Navigator/Navigator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,17 @@ describe('Header Navigator', () => {
function setup({ isMyOrg = true }: SetupArgs) {
server.use(
graphql.query('MyContexts', (info) => {
return HttpResponse.json({ data: mockMyContexts }, { status: 200 })
return HttpResponse.json({ data: mockMyContexts })
}),
graphql.query('DetailOwner', (info) => {
return HttpResponse.json({ data: mockDetailOwner }, { status: 200 })
return HttpResponse.json({ data: mockDetailOwner })
}),
graphql.query('OwnerPageData', (info) => {
if (isMyOrg) {
return HttpResponse.json({ data: mockOwnerPageData }, { status: 200 })
return HttpResponse.json({ data: mockOwnerPageData })
}

return HttpResponse.json(
{ data: mockOwnerPageDataNotInOrg },
{ status: 200 }
)
return HttpResponse.json({ data: mockOwnerPageDataNotInOrg })
})
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('UserDropdown', () => {
return HttpResponse.json({}, { status: 205 })
}),
graphql.query('CurrentUser', (info) => {
return HttpResponse.json({ data: mockUser }, { status: 200 })
return HttpResponse.json({ data: mockUser })
})
)

Expand Down

0 comments on commit d064eb2

Please sign in to comment.