Skip to content

Commit

Permalink
test(API): Fix issues with Public API tests (#3515)
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoE105 authored Jun 18, 2022
1 parent 189009a commit c4b63fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/cli/test/integration/publicApi/credentials.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ let credentialOwnerRole: Role;

let saveCredential: SaveCredentialFunction;

jest.mock('../../../src/telemetry');

beforeAll(async () => {
app = await utils.initTestServer({ endpointGroups: ['publicApi'], applyAuth: false });
const initResult = await testDb.init();
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/test/integration/publicApi/executions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { randomApiKey } from '../shared/random';
import * as utils from '../shared/utils';
import * as testDb from '../shared/testDb';

jest.mock('../../../src/telemetry');

let app: express.Application;
let testDbName = '';
let globalOwnerRole: Role;
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/test/integration/publicApi/workflows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ let globalMemberRole: Role;
let workflowOwnerRole: Role;
let workflowRunner: ActiveWorkflowRunner.ActiveWorkflowRunner;

jest.mock('../../../src/telemetry');

beforeAll(async () => {
app = await utils.initTestServer({ endpointGroups: ['publicApi'], applyAuth: false });
const initResult = await testDb.init();
Expand All @@ -34,6 +36,7 @@ beforeAll(async () => {
utils.initTestTelemetry();
utils.initTestLogger();
await utils.initNodeTypes();
await utils.initConfigFile();
workflowRunner = await utils.initActiveWorkflowRunner();
});

Expand Down Expand Up @@ -648,7 +651,7 @@ test('POST /workflows/:id/activate should fail due to trying to activate a workf
expect(response.statusCode).toBe(400);
});

test.skip('POST /workflows/:id/activate should set workflow as active', async () => {
test('POST /workflows/:id/activate should set workflow as active', async () => {
const member = await testDb.createUser({ globalRole: globalMemberRole, apiKey: randomApiKey() });

const authAgent = utils.createAgent(app, {
Expand Down Expand Up @@ -692,7 +695,7 @@ test.skip('POST /workflows/:id/activate should set workflow as active', async ()
expect(await workflowRunner.isActive(workflow.id.toString())).toBe(true);
});

test.skip('POST /workflows/:id/activate should set non-owned workflow as active when owner', async () => {
test('POST /workflows/:id/activate should set non-owned workflow as active when owner', async () => {
const owner = await testDb.createUser({ globalRole: globalOwnerRole, apiKey: randomApiKey() });
const member = await testDb.createUser({ globalRole: globalMemberRole });

Expand Down

0 comments on commit c4b63fa

Please sign in to comment.