fix(core): Fix type errors (no-changelog) (#9571)

This commit is contained in:
Danny Martini
2024-05-31 14:06:13 +02:00
committed by GitHub
parent 400c005866
commit 8da0d6e9ba
22 changed files with 30 additions and 42 deletions

View File

@@ -240,7 +240,7 @@ describe('POST /external-secrets/providers/:provider', () => {
const resp = await authOwnerAgent.post('/external-secrets/providers/dummy').send(testData);
expect(resp.status).toBe(200);
const confirmResp = await authOwnerAgent.get('/external-secrets/providers/dummy');
await authOwnerAgent.get('/external-secrets/providers/dummy');
expect((await getExternalSecretsSettings())?.dummy.settings).toEqual({
username: 'newuser',
password: 'testpass',

View File

@@ -26,7 +26,6 @@ import {
import type { User } from '@/databases/entities/User';
import type { UserInvitationResult } from '../../shared/utils/users';
import { ProjectRepository } from '@/databases/repositories/project.repository';
import { ProjectRelationRepository } from '@/databases/repositories/projectRelation.repository';
describe('InvitationController', () => {
@@ -38,12 +37,10 @@ describe('InvitationController', () => {
let instanceOwner: User;
let userRepository: UserRepository;
let projectRepository: ProjectRepository;
let projectRelationRepository: ProjectRelationRepository;
beforeAll(async () => {
userRepository = Container.get(UserRepository);
projectRepository = Container.get(ProjectRepository);
projectRelationRepository = Container.get(ProjectRelationRepository);
instanceOwner = await createOwner();
});

View File

@@ -536,7 +536,7 @@ describe('PUT /credentials/:id/share', () => {
test('should respond 200 for non-owned credentials for owners', async () => {
const savedCredential = await saveCredential(randomCredentialPayload(), { user: member });
const response = await authOwnerAgent
await authOwnerAgent
.put(`/credentials/${savedCredential.id}/share`)
.send({ shareWithIds: [anotherMemberPersonalProject.id] })
.expect(200);

View File

@@ -9,7 +9,6 @@ import { ProjectRepository } from '@db/repositories/project.repository';
import type { Project } from '@db/entities/Project';
import { CredentialsRepository } from '@db/repositories/credentials.repository';
import { SharedCredentialsRepository } from '@db/repositories/sharedCredentials.repository';
import { ProjectService } from '@/services/project.service';
import * as testDb from '../shared/testDb';
import { setupTestServer } from '../shared/utils';
@@ -44,7 +43,6 @@ let authMemberAgent: SuperAgentTest;
let projectRepository: ProjectRepository;
let sharedCredentialsRepository: SharedCredentialsRepository;
let projectService: ProjectService;
beforeEach(async () => {
await testDb.truncate(['SharedCredentials', 'Credentials']);
@@ -65,7 +63,6 @@ beforeEach(async () => {
projectRepository = Container.get(ProjectRepository);
sharedCredentialsRepository = Container.get(SharedCredentialsRepository);
projectService = Container.get(ProjectService);
});
type GetAllResponse = { body: { data: ListQuery.Credentials.WithOwnedByAndSharedWith[] } };

View File

@@ -130,6 +130,5 @@ const DEFAULT_POST_RESPONSE: { data: ILicensePostResponse } = {
},
};
const UNAUTHORIZED_RESPONSE = { status: 'error', message: 'Unauthorized' };
const ACTIVATION_FAILED_MESSAGE = 'Failed to activate license';
const GENERIC_ERROR_MESSAGE = 'Something went wrong';

View File

@@ -912,7 +912,7 @@ describe('PATCH /users/:id/role', () => {
createTeamProject(),
]);
const [credential1, credential2, credential3] = await Promise.all([
await Promise.all([
saveCredential(randomCredentialPayload(), {
user,
role: 'credential:owner',

View File

@@ -306,7 +306,7 @@ describe('PATCH /variables/:id', () => {
});
test('should not modify existing variable if one with the same key exists', async () => {
const [var1, var2] = await Promise.all([
const [var1] = await Promise.all([
createVariable('test1', 'value1'),
createVariable(toModify.key, toModify.value),
]);
@@ -327,7 +327,7 @@ describe('PATCH /variables/:id', () => {
// ----------------------------------------
describe('DELETE /variables/:id', () => {
test('should delete a single variable for an owner', async () => {
const [var1, var2, var3] = await Promise.all([
const [var1] = await Promise.all([
createVariable('test1', 'value1'),
createVariable('test2', 'value2'),
createVariable('test3', 'value3'),
@@ -344,7 +344,7 @@ describe('DELETE /variables/:id', () => {
});
test('should not delete a single variable for a member', async () => {
const [var1, var2, var3] = await Promise.all([
const [var1] = await Promise.all([
createVariable('test1', 'value1'),
createVariable('test2', 'value2'),
createVariable('test3', 'value3'),

View File

@@ -91,7 +91,7 @@ describe('GET /workflow-history/:workflowId', () => {
),
);
const versions2 = await Promise.all(
await Promise.all(
new Array(10).fill(undefined).map(async (_) => await createWorkflowHistoryItem(workflow2.id)),
);