Skip to content

Commit

Permalink
Merge pull request #12 from DIMO-Network/hotfix
Browse files Browse the repository at this point in the history
update test
  • Loading branch information
jamesliupenn authored Nov 14, 2024
2 parents 8de7bd8 + 3a3905b commit f81be5d
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/api/Method.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ const RESOURCE = {
const PARAM = { param1: 'value1' };

describe('Method Function', () => {
test('Valid API Call - Device Data API Server is up and returning data', async () => {
jest.spyOn(axios, 'request').mockResolvedValue({ data: { key: 'value' } });

const devResponse = await Method(RESOURCE, DimoEnvironment.Dev.DeviceData, PARAM, DEV);
const prodResponse = await Method(RESOURCE, DimoEnvironment.Production.DeviceData, PARAM, PROD);

// Assertion - Check if the response data is returned correctly
expect(devResponse).toEqual({ code: 200, message: 'Server is up.' });
expect(prodResponse).toEqual({ code: 200, message: 'Server is up.' });
});

test('Valid API Call - Device Definitions API Server is up and returning data', async () => {
jest.spyOn(axios, 'request').mockResolvedValue({ data: { key: 'value' } });

Expand All @@ -47,17 +36,6 @@ describe('Method Function', () => {
expect(prodResponse).toEqual({ data: 'Server is up and running' });
});

test('Valid API Call - Events API Server is up and returning data', async () => {
jest.spyOn(axios, 'request').mockResolvedValue({ data: { key: 'value' } });

const devResponse = await Method(RESOURCE, DimoEnvironment.Dev.Events, PARAM, DEV);
const prodResponse = await Method(RESOURCE, DimoEnvironment.Production.Events, PARAM, PROD);

// Assertion - Check if the response data is returned correctly
expect(devResponse).toEqual({ data: 'Server is up and running' });
expect(prodResponse).toEqual({ data: 'Server is up and running' });
});

test('Valid API Call - Token Exchange API Server is up and returning data', async () => {
jest.spyOn(axios, 'request').mockResolvedValue({ data: { key: 'value' } });

Expand All @@ -69,17 +47,6 @@ describe('Method Function', () => {
expect(prodResponse).toEqual({ data: 'Server is up and running' });
});

test('Valid API Call - Users API Server is up and returning data', async () => {
jest.spyOn(axios, 'request').mockResolvedValue({ data: { key: 'value' } });

const devResponse = await Method(RESOURCE, DimoEnvironment.Dev.User, PARAM, DEV);
const prodResponse = await Method(RESOURCE, DimoEnvironment.Production.User, PARAM, PROD);

// Assertion - Check if the response data is returned correctly
expect(devResponse).toEqual({ data: 'Server is up and running' });
expect(prodResponse).toEqual({ data: 'Server is up and running' });
});

test('Valid API Call - Valuations API Server is up and returning data', async () => {
jest.spyOn(axios, 'request').mockResolvedValue({ data: { key: 'value' } });

Expand Down

0 comments on commit f81be5d

Please sign in to comment.