mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Mark all backend Enterprise Edition files and dirs (#12350)
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { InstanceSettings } from 'n8n-core';
|
||||
import { Container } from 'typedi';
|
||||
|
||||
import { SourceControlPreferencesService } from '@/environments.ee/source-control/source-control-preferences.service.ee';
|
||||
import { SourceControlService } from '@/environments.ee/source-control/source-control.service.ee';
|
||||
|
||||
describe('SourceControlService', () => {
|
||||
const preferencesService = new SourceControlPreferencesService(
|
||||
Container.get(InstanceSettings),
|
||||
mock(),
|
||||
mock(),
|
||||
);
|
||||
const sourceControlService = new SourceControlService(
|
||||
mock(),
|
||||
mock(),
|
||||
preferencesService,
|
||||
mock(),
|
||||
mock(),
|
||||
mock(),
|
||||
mock(),
|
||||
);
|
||||
|
||||
describe('pushWorkfolder', () => {
|
||||
it('should throw an error if a file is given that is not in the workfolder', async () => {
|
||||
jest.spyOn(sourceControlService, 'sanityCheck').mockResolvedValue(undefined);
|
||||
|
||||
await expect(
|
||||
sourceControlService.pushWorkfolder({
|
||||
fileNames: [
|
||||
{
|
||||
file: '/etc/passwd',
|
||||
id: 'test',
|
||||
name: 'secret-file',
|
||||
type: 'file',
|
||||
status: 'modified',
|
||||
location: 'local',
|
||||
conflict: false,
|
||||
updatedAt: new Date().toISOString(),
|
||||
pushed: false,
|
||||
},
|
||||
],
|
||||
}),
|
||||
).rejects.toThrow('File path /etc/passwd is invalid');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user