Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(status-api): Update Blockchain Status API path #1318

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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