mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
chore(core): Add test case for getStatus pull case (no-changelog) (#15598)
This commit is contained in:
@@ -11,6 +11,7 @@ import { InstanceSettings } from 'n8n-core';
|
||||
|
||||
import { SourceControlPreferencesService } from '@/environments.ee/source-control/source-control-preferences.service.ee';
|
||||
import { SourceControlService } from '@/environments.ee/source-control/source-control.service.ee';
|
||||
import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
|
||||
|
||||
import type { SourceControlImportService } from '../source-control-import.service.ee';
|
||||
import type { ExportableCredential } from '../types/exportable-credential';
|
||||
@@ -243,5 +244,20 @@ describe('SourceControlService', () => {
|
||||
expect(pullResult.find((i) => i.type === 'folders')).toHaveProperty('conflict', true);
|
||||
expect(pushResult.find((i) => i.type === 'folders')).toHaveProperty('conflict', false);
|
||||
});
|
||||
|
||||
it('should throw `ForbiddenError` if direction is pull and user is not allowed to globally pull', async () => {
|
||||
// ARRANGE
|
||||
const user = mock<User>();
|
||||
user.role = 'global:member';
|
||||
|
||||
// ACT
|
||||
await expect(
|
||||
sourceControlService.getStatus(user, {
|
||||
direction: 'pull',
|
||||
verbose: false,
|
||||
preferLocalVersion: false,
|
||||
}),
|
||||
).rejects.toThrowError(ForbiddenError);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user