Merge pull request #2033 from automatisch/refactor-test-connection

Refactor test connection action
This commit is contained in:
Ömer Faruk Aydın
2024-08-26 16:35:16 +03:00
committed by GitHub
5 changed files with 8 additions and 4 deletions

View File

@@ -9,7 +9,6 @@ import deleteConnection from './mutations/delete-connection.js';
import deleteCurrentUser from './mutations/delete-current-user.ee.js';
import deleteFlow from './mutations/delete-flow.js';
import deleteRole from './mutations/delete-role.ee.js';
import deleteStep from './mutations/delete-step.js';
import duplicateFlow from './mutations/duplicate-flow.js';
import executeFlow from './mutations/execute-flow.js';
import generateAuthUrl from './mutations/generate-auth-url.js';
@@ -29,6 +28,9 @@ import upsertSamlAuthProvider from './mutations/upsert-saml-auth-provider.ee.js'
import upsertSamlAuthProvidersRoleMappings from './mutations/upsert-saml-auth-providers-role-mappings.ee.js';
import verifyConnection from './mutations/verify-connection.js';
// Converted mutations
import deleteStep from './mutations/delete-step.js';
const mutationResolvers = {
createAppAuthClient,
createAppConfig,

View File

@@ -3,7 +3,7 @@ import asyncHandler from 'express-async-handler';
import { authenticateUser } from '../../../helpers/authentication.js';
import { authorizeUser } from '../../../helpers/authorization.js';
import getFlowsAction from '../../../controllers/api/v1/connections/get-flows.js';
import createTestAction from '../../../controllers/api/v1/connections/create-test.js';
import testConnectionAction from '../../../controllers/api/v1/connections/test-connection.js';
const router = Router();
@@ -18,7 +18,7 @@ router.post(
'/:connectionId/test',
authenticateUser,
authorizeUser,
asyncHandler(createTestAction)
asyncHandler(testConnectionAction)
);
export default router;

View File

@@ -8,7 +8,9 @@ global.beforeAll(async () => {
logger.silent = true;
// Remove default roles and permissions before running the test suite
await knex.raw('TRUNCATE TABLE config, roles, permissions CASCADE');
await knex.raw('TRUNCATE TABLE config CASCADE');
await knex.raw('TRUNCATE TABLE roles CASCADE');
await knex.raw('TRUNCATE TABLE permissions CASCADE');
});
global.beforeEach(async () => {