From f9ec7ed746cd5184604484b86507ac229c938263 Mon Sep 17 00:00:00 2001 From: cfaur09 Date: Tue, 3 Dec 2024 12:32:52 +0200 Subject: [PATCH] Create delegation.cs-e2e.ts --- src/test/chain-simulator/delegation.cs-e2e.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/chain-simulator/delegation.cs-e2e.ts diff --git a/src/test/chain-simulator/delegation.cs-e2e.ts b/src/test/chain-simulator/delegation.cs-e2e.ts new file mode 100644 index 000000000..0049d9366 --- /dev/null +++ b/src/test/chain-simulator/delegation.cs-e2e.ts @@ -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']); + }); + }); +});