mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Make enterprise trial requests via the backend (no-changelog) (#9784)
This commit is contained in:
committed by
GitHub
parent
f7d7404907
commit
876bcbb04c
@@ -1,3 +1,4 @@
|
||||
import nock from 'nock';
|
||||
import config from '@/config';
|
||||
import { RESPONSE_ERROR_MESSAGES } from '@/constants';
|
||||
import type { User } from '@db/entities/User';
|
||||
@@ -47,6 +48,20 @@ describe('GET /license', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /license/enterprise/request_trial', () => {
|
||||
nock('https://enterprise.n8n.io').post('/enterprise-trial').reply(200);
|
||||
|
||||
test('should work for instance owner', async () => {
|
||||
await authOwnerAgent.post('/license/enterprise/request_trial').expect(200);
|
||||
});
|
||||
|
||||
test('does not work for regular users', async () => {
|
||||
await authMemberAgent
|
||||
.post('/license/enterprise/request_trial')
|
||||
.expect(403, { status: 'error', message: RESPONSE_ERROR_MESSAGES.MISSING_SCOPE });
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /license/activate', () => {
|
||||
test('should work for instance owner', async () => {
|
||||
await authOwnerAgent
|
||||
|
||||
Reference in New Issue
Block a user