mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34:07 -08:00
b895ba438a
refactor(core): Reduce boilterplate code in between tests also cleaned up some imports, and fixed the tests in node.js 20
28 lines
815 B
TypeScript
28 lines
815 B
TypeScript
import type { SuperAgentTest } from 'supertest';
|
|
import { SOURCE_CONTROL_API_ROOT } from '@/environments/sourceControl/constants';
|
|
import * as testDb from '../shared/testDb';
|
|
import * as utils from '../shared/utils/';
|
|
|
|
let authOwnerAgent: SuperAgentTest;
|
|
|
|
const testServer = utils.setupTestServer({
|
|
endpointGroups: ['sourceControl'],
|
|
enabledFeatures: ['feat:sourceControl'],
|
|
});
|
|
|
|
beforeAll(async () => {
|
|
const owner = await testDb.createOwner();
|
|
authOwnerAgent = testServer.authAgentFor(owner);
|
|
});
|
|
|
|
describe('GET /sourceControl/preferences', () => {
|
|
test('should return Source Control preferences', async () => {
|
|
await authOwnerAgent
|
|
.get(`/${SOURCE_CONTROL_API_ROOT}/preferences`)
|
|
.expect(200)
|
|
.expect((res) => {
|
|
return 'repositoryUrl' in res.body && 'branchName' in res.body;
|
|
});
|
|
});
|
|
});
|