refactor(core): Lintfix cli package (#17125)

This commit is contained in:
Iván Ovejero
2025-07-08 19:32:02 +02:00
committed by GitHub
parent 32fbb5cf6a
commit f3ef0a713c
179 changed files with 647 additions and 693 deletions

View File

@@ -1,7 +1,5 @@
import type { SourceControlledFile } from '@n8n/api-types';
import { createTeamProject } from '@n8n/backend-test-utils';
import { createWorkflow } from '@n8n/backend-test-utils';
import { testDb } from '@n8n/backend-test-utils';
import { createTeamProject, createWorkflow, testDb } from '@n8n/backend-test-utils';
import {
CredentialsEntity,
type Folder,
@@ -229,7 +227,7 @@ describe('SourceControlService', () => {
createTeamProject('ProjectB'),
]);
let [
const [
globalAdminWorkflows,
globalOwnerWorkflows,
globalMemberWorkflows,
@@ -324,7 +322,7 @@ describe('SourceControlService', () => {
),
]);
let [projectACredentials, projectBCredentials] = await Promise.all(
const [projectACredentials, projectBCredentials] = await Promise.all(
[projectA, projectB].map(async (project) => [
await createCredentials(
{
@@ -367,7 +365,7 @@ describe('SourceControlService', () => {
}),
);
let [projectAFolders, projectBFolders] = await Promise.all(
const [projectAFolders, projectBFolders] = await Promise.all(
[projectA, projectB].map(async (project) => {
const parent = await createFolder(project, {
name: `${project.name}-FolderA`,
@@ -536,7 +534,7 @@ describe('SourceControlService', () => {
describe('direction: push', () => {
describe('global:admin user', () => {
it('should see all workflows', async () => {
let result = await service.getStatus(globalAdmin, {
const result = await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -600,7 +598,7 @@ describe('SourceControlService', () => {
});
it('should see all credentials', async () => {
let result = await service.getStatus(globalAdmin, {
const result = await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -637,7 +635,7 @@ describe('SourceControlService', () => {
});
it('should see all folder', async () => {
let result = await service.getStatus(globalAdmin, {
const result = await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -664,7 +662,7 @@ describe('SourceControlService', () => {
describe('global:member user', () => {
it('should see nothing', async () => {
let result = await service.getStatus(globalMember, {
const result = await service.getStatus(globalMember, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -676,7 +674,7 @@ describe('SourceControlService', () => {
describe('project:Admin user', () => {
it('should see only workflows in correct scope', async () => {
let result = await service.getStatus(projectAdmin, {
const result = await service.getStatus(projectAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -736,7 +734,7 @@ describe('SourceControlService', () => {
});
it('should see only credentials in correct scope', async () => {
let result = await service.getStatus(projectAdmin, {
const result = await service.getStatus(projectAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -773,7 +771,7 @@ describe('SourceControlService', () => {
});
it('should see only folders in correct scope', async () => {
let result = await service.getStatus(projectAdmin, {
const result = await service.getStatus(projectAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -836,7 +834,7 @@ describe('SourceControlService', () => {
});
it('should fail with BadRequest', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -853,7 +851,7 @@ describe('SourceControlService', () => {
describe('global:admin user', () => {
it('should update all workflows, credentials, tags and folder', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -887,7 +885,7 @@ describe('SourceControlService', () => {
});
it('should update all workflows and credentials without arguments', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -940,7 +938,7 @@ describe('SourceControlService', () => {
describe('project:admin', () => {
it('should update selected workflows, credentials, tags and folders', async () => {
let allChanges = (await service.getStatus(projectAdmin, {
const allChanges = (await service.getStatus(projectAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -974,7 +972,7 @@ describe('SourceControlService', () => {
});
it('should throw ForbiddenError when trying to push workflows out of scope', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -995,7 +993,7 @@ describe('SourceControlService', () => {
});
it('should throw ForbiddenError when trying to push credentials out of scope', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -1035,7 +1033,7 @@ describe('SourceControlService', () => {
// Add a new tag to newly assigned workflow
await assignTagToWorkflow(tags[1], movedIntoScopeWorkflow);
let allChanges = (await service.getStatus(projectAdmin, {
const allChanges = (await service.getStatus(projectAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -1065,7 +1063,7 @@ describe('SourceControlService', () => {
});
it('should update folders in scope and keep out of scope ones', async () => {
let allChanges = (await service.getStatus(projectAdmin, {
const allChanges = (await service.getStatus(projectAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -1103,7 +1101,7 @@ describe('SourceControlService', () => {
describe('global:member', () => {
it('should deny all changes', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,
@@ -1118,7 +1116,7 @@ describe('SourceControlService', () => {
});
it('should deny any changes', async () => {
let allChanges = (await service.getStatus(globalAdmin, {
const allChanges = (await service.getStatus(globalAdmin, {
direction: 'push',
preferLocalVersion: true,
verbose: false,