Skip to content

Commit

Permalink
Merge b622082 into b1fb347
Browse files Browse the repository at this point in the history
  • Loading branch information
nichellekoh authored Apr 4, 2022
2 parents b1fb347 + b622082 commit ce530d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ describe('BlockchainController - Status test', () => {
await apiTesting.stop()
})

it('/blockchain/status - should get operational', async () => {
it('/blockchain - should get operational', async () => {
jest
.spyOn(apiTesting.app.get(WhaleApiClient).blocks, 'list')
.mockReturnValueOnce(getBlockResponseWithPresetTime(25))

const res = await apiTesting.app.inject({
method: 'GET',
url: '/blockchain/status'
url: '/blockchain'
})

expect(res.statusCode).toStrictEqual(200)
Expand All @@ -27,14 +27,14 @@ describe('BlockchainController - Status test', () => {
})
})

it('/blockchain/status - should get degraded', async () => {
it('/blockchain - should get degraded', async () => {
jest
.spyOn(apiTesting.app.get(WhaleApiClient).blocks, 'list')
.mockReturnValueOnce(getBlockResponseWithPresetTime(36))

const res = await apiTesting.app.inject({
method: 'GET',
url: '/blockchain/status'
url: '/blockchain'
})

expect(res.statusCode).toStrictEqual(200)
Expand All @@ -43,14 +43,14 @@ describe('BlockchainController - Status test', () => {
})
})

it('/blockchain/status - should get outage', async () => {
it('/blockchain - should get outage', async () => {
jest
.spyOn(apiTesting.app.get(WhaleApiClient).blocks, 'list')
.mockReturnValueOnce(getBlockResponseWithPresetTime(46))

const res = await apiTesting.app.inject({
method: 'GET',
url: '/blockchain/status'
url: '/blockchain'
})

expect(res.statusCode).toStrictEqual(200)
Expand Down
2 changes: 1 addition & 1 deletion apps/status-api/src/controllers/BlockchainController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class BlockchainController {
constructor (private readonly client: WhaleApiClient) {
}

@Get('status')
@Get()
async getBlockChainStatus (): Promise<{ [key: string]: string }> {
const blocks: Block[] = await this.client.blocks.list(1)

Expand Down

0 comments on commit ce530d1

Please sign in to comment.