From 08ac081b37cd6115634e8951608116fe0f13032b Mon Sep 17 00:00:00 2001 From: Kimsible Date: Wed, 28 Apr 2021 18:26:26 +0200 Subject: Add test for API actors route --- shared/extra-utils/actors/actors.ts | 18 ++++++++++++++++++ shared/extra-utils/index.ts | 1 + 2 files changed, 19 insertions(+) create mode 100644 shared/extra-utils/actors/actors.ts (limited to 'shared/extra-utils') diff --git a/shared/extra-utils/actors/actors.ts b/shared/extra-utils/actors/actors.ts new file mode 100644 index 000000000..4a4aba775 --- /dev/null +++ b/shared/extra-utils/actors/actors.ts @@ -0,0 +1,18 @@ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ + +import { makeGetRequest } from '../requests/requests' +import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' + +function getActor (url: string, actorName: string, statusCodeExpected = HttpStatusCode.OK_200) { + const path = '/api/v1/actors/' + actorName + + return makeGetRequest({ + url, + path, + statusCodeExpected + }) +} + +export { + getActor +} diff --git a/shared/extra-utils/index.ts b/shared/extra-utils/index.ts index 898a92d43..5c520d0c2 100644 --- a/shared/extra-utils/index.ts +++ b/shared/extra-utils/index.ts @@ -1,3 +1,4 @@ +export * from './actors/actors' export * from './bulk/bulk' export * from './cli/cli' export * from './feeds/feeds' -- cgit v1.2.3