-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create delegation-legacy.cs-e2e.ts (#1404)
* Create delegation-legacy.cs-e2e.ts * Update delegation-legacy.cs-e2e.ts
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import axios from 'axios'; | ||
import { config } from "./config/env.config"; | ||
import { ChainSimulatorUtils } from "./utils/test.utils"; | ||
|
||
// TODO: Uncomment this test once the legacy delegation legacy contract is deployed | ||
describe.skip('Delegation legacy e2e tests with chain simulator', () => { | ||
beforeAll(async () => { | ||
await ChainSimulatorUtils.waitForEpoch(2); | ||
}); | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
describe('GET /delegations-legacy', () => { | ||
it('should return status code 200 and a delegation legacy object details', async () => { | ||
const response = await axios.get(`${config.apiServiceUrl}/delegation-legacy`); | ||
const properties = Object.keys(response.data); | ||
|
||
expect(response.status).toBe(200); | ||
const expectedProperties = [ | ||
'totalWithdrawOnlyStake', | ||
'totalWaitingStake', | ||
'totalActiveStake', | ||
'totalUnstakedStake', | ||
'totalDeferredPaymentStake', | ||
'numUsers', | ||
]; | ||
|
||
expect(properties).toEqual(expectedProperties); | ||
}); | ||
}); | ||
}); |