actuatorInfo.spec.ts 650 B

1234567891011121314151617
  1. import fetchMock from 'fetch-mock';
  2. import * as hooks from 'lib/hooks/api/actuatorInfo';
  3. import { expectQueryWorks, renderQueryHook } from 'lib/testHelpers';
  4. import { actuatorInfoPayload } from 'lib/fixtures/actuatorInfo';
  5. const actuatorInfoPath = '/actuator/info';
  6. describe('Actuator info hooks', () => {
  7. beforeEach(() => fetchMock.restore());
  8. describe('useActuatorInfo', () => {
  9. it('returns the correct data', async () => {
  10. const mock = fetchMock.getOnce(actuatorInfoPath, actuatorInfoPayload());
  11. const { result } = renderQueryHook(() => hooks.useActuatorInfo());
  12. await expectQueryWorks(mock, result);
  13. });
  14. });
  15. });