test(core): Fix typing issues in tests (no-changelog) (#10244)

This commit is contained in:
Tomi Turtiainen
2024-07-30 21:24:01 +03:00
committed by GitHub
parent 5b47c8b57b
commit 3d23f2f333
18 changed files with 41 additions and 38 deletions

View File

@@ -31,7 +31,6 @@ describe('ProjectService', () => {
describe('when user has roles in projects where workflow is accessible', () => {
it('should return roles and project IDs', async () => {
const user = await createUser();
const secondUser = await createUser(); // @TODO: Needed only to satisfy index in legacy column
const firstProject = await createTeamProject('Project 1');
const secondProject = await createTeamProject('Project 2');
@@ -42,17 +41,15 @@ describe('ProjectService', () => {
const workflow = await createWorkflow();
await sharedWorkflowRepository.insert({
userId: user.id, // @TODO: Legacy column
projectId: firstProject.id,
workflowId: workflow.id,
role: 'workflow:owner',
});
await sharedWorkflowRepository.insert({
userId: secondUser.id, // @TODO: Legacy column
projectId: secondProject.id,
workflowId: workflow.id,
role: 'workflow:user',
role: 'workflow:owner',
});
const projectIds = await projectService.findProjectsWorkflowIsIn(workflow.id);
@@ -63,9 +60,6 @@ describe('ProjectService', () => {
describe('when user has no roles in projects where workflow is accessible', () => {
it('should return project IDs but no roles', async () => {
const user = await createUser();
const secondUser = await createUser(); // @TODO: Needed only to satisfy index in legacy column
const firstProject = await createTeamProject('Project 1');
const secondProject = await createTeamProject('Project 2');
@@ -74,17 +68,15 @@ describe('ProjectService', () => {
const workflow = await createWorkflow();
await sharedWorkflowRepository.insert({
userId: user.id, // @TODO: Legacy column
projectId: firstProject.id,
workflowId: workflow.id,
role: 'workflow:owner',
});
await sharedWorkflowRepository.insert({
userId: secondUser.id, // @TODO: Legacy column
projectId: secondProject.id,
workflowId: workflow.id,
role: 'workflow:user',
role: 'workflow:owner',
});
const projectIds = await projectService.findProjectsWorkflowIsIn(workflow.id);