Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
KorbinianK committed Jun 8, 2024
1 parent 02a80be commit 826492d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/bridge-ui/src/libs/relayer/RelayerAPIService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ describe('RelayerAPIService', () => {
setupMocks();
});

afterEach(() => {
vi.clearAllMocks();
vi.resetAllMocks();
});

// Given
const mockedAxios = vi.mocked(axios, true);

Expand Down Expand Up @@ -60,6 +65,17 @@ describe('RelayerAPIService', () => {
const paginationParams = { page: 1, size: 10 };
const chainID = 1;

const mockResponse = {
data: {
page: 1,
size: 10,
total: 100,
items: [],
},
status: 200,
};
mockedAxios.get.mockResolvedValue(mockResponse);

// When
const result = await relayerAPIService.getAllBridgeTransactionByAddress(address, paginationParams, chainID);

Expand All @@ -69,7 +85,7 @@ describe('RelayerAPIService', () => {
expect(result.paginationInfo).toBeDefined();
});

test('getTransactionsFromAPI should return API response', async () => {
test('getTransactionsFromAPI should return API response for full mock with valid conversion', async () => {
// Given
const baseUrl = 'http://example.com';
const relayerAPIService = new RelayerAPIService(baseUrl);
Expand Down

0 comments on commit 826492d

Please sign in to comment.