Skip to content

Commit

Permalink
Create delegation.cs-e2e.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cfaur09 committed Dec 3, 2024
1 parent 4b591c7 commit f9ec7ed
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/chain-simulator/delegation.cs-e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import axios from 'axios';
import { config } from "./config/env.config";
import { ChainSimulatorUtils } from "./utils/test.utils";

describe('Delegation e2e tests with chain simulator', () => {
beforeAll(async () => {
await ChainSimulatorUtils.waitForEpoch(2);
});

beforeEach(() => {
jest.clearAllMocks();
});

describe('GET /delegations', () => {
it('should return status code 200', async () => {
const response = await axios.get(`${config.apiServiceUrl}/delegation`);
expect(response.status).toBe(200);
});

it('should return delegation details', async () => {
const response = await axios.get(`${config.apiServiceUrl}/delegation`);
const properties = Object.keys(response.data);

expect(properties).toEqual(['stake', 'topUp', 'locked', 'minDelegation']);
});
});
});

0 comments on commit f9ec7ed

Please sign in to comment.