test(composer): reuse fixtures to restore the main lint gate

This commit is contained in:
Neil
2026-10-10 16:04:08 -07:00
committed by Neil
parent 808c4ae9a6
commit 7dfcef4e10
4 changed files with 39 additions and 73 deletions
@@ -150,8 +150,7 @@ export function useAutomationsPageSetupState({
automationYamlHooksByRepoKey,
getAutomationHooksCacheKey,
repos,
setAutomationYamlHooksByRepoKey,
settings
setAutomationYamlHooksByRepoKey
]
)
const getDraftSetupDecisionDefaultSignature = useCallback(
@@ -0,0 +1,36 @@
import type { FolderWorkspace } from '../../../../shared/folder-workspace-types'
import type { ProjectGroup } from '../../../../shared/project-group-types'
export function makeProjectGroup(): ProjectGroup {
return {
id: 'group-1',
name: 'Platform',
parentPath: '/repo/platform',
parentGroupId: null,
createdFrom: 'folder-scan',
tabOrder: 0,
isCollapsed: false,
color: null,
createdAt: 1,
updatedAt: 1
}
}
export function makeFolderWorkspace(overrides: Partial<FolderWorkspace> = {}): FolderWorkspace {
return {
id: 'folder-workspace-1',
projectGroupId: 'group-1',
name: 'hi',
folderPath: '/repo/platform/hi',
linkedTask: null,
comment: '',
isArchived: false,
isUnread: false,
isPinned: false,
sortOrder: 0,
lastActivityAt: 1,
createdAt: 1,
updatedAt: 1,
...overrides
}
}
@@ -1,8 +1,7 @@
// @vitest-environment happy-dom
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { FolderWorkspace } from '../../../../shared/folder-workspace-types'
import type { ProjectGroup } from '../../../../shared/project-group-types'
import { makeProjectGroup, makeFolderWorkspace } from './folder-workspace-composer-submit-fixtures'
const mocks = vi.hoisted(() => ({ activateAndRevealFolderWorkspace: vi.fn() }))
@@ -14,39 +13,6 @@ vi.mock('@/lib/worktree-activation', async (importOriginal) => {
import { useAppStore } from '@/store'
import { submitFolderWorkspaceCreate } from './folder-workspace-composer-submit'
function makeProjectGroup(): ProjectGroup {
return {
id: 'group-1',
name: 'Platform',
parentPath: '/repo/platform',
parentGroupId: null,
createdFrom: 'folder-scan',
tabOrder: 0,
isCollapsed: false,
color: null,
createdAt: 1,
updatedAt: 1
}
}
function makeFolderWorkspace(): FolderWorkspace {
return {
id: 'folder-workspace-1',
projectGroupId: 'group-1',
name: 'hi',
folderPath: '/repo/platform/hi',
linkedTask: null,
comment: '',
isArchived: false,
isUnread: false,
isPinned: false,
sortOrder: 0,
lastActivityAt: 1,
createdAt: 1,
updatedAt: 1
}
}
// Why: a folder group on an Orca server runs its agents there, so the server's OS decides quoting.
describe('submitFolderWorkspaceCreate on an Orca server', () => {
afterEach(() => {
@@ -1,8 +1,7 @@
// @vitest-environment happy-dom
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type { FolderWorkspace } from '../../../../shared/folder-workspace-types'
import type { ProjectGroup } from '../../../../shared/project-group-types'
import { makeProjectGroup, makeFolderWorkspace } from './folder-workspace-composer-submit-fixtures'
import { folderWorkspaceKey } from '../../../../shared/workspace-scope'
import type * as NewWorkspaceModule from '@/lib/new-workspace'
@@ -30,40 +29,6 @@ import {
submitFolderWorkspaceCreate
} from './folder-workspace-composer-submit'
function makeProjectGroup(): ProjectGroup {
return {
id: 'group-1',
name: 'Platform',
parentPath: '/repo/platform',
parentGroupId: null,
createdFrom: 'folder-scan',
tabOrder: 0,
isCollapsed: false,
color: null,
createdAt: 1,
updatedAt: 1
}
}
function makeFolderWorkspace(overrides: Partial<FolderWorkspace> = {}): FolderWorkspace {
return {
id: 'folder-workspace-1',
projectGroupId: 'group-1',
name: 'hi',
folderPath: '/repo/platform/hi',
linkedTask: null,
comment: '',
isArchived: false,
isUnread: false,
isPinned: false,
sortOrder: 0,
lastActivityAt: 1,
createdAt: 1,
updatedAt: 1,
...overrides
}
}
describe('submitFolderWorkspaceCreate', () => {
it.each(['347', '002'])('keeps manual folder name %s with its linked source', async (name) => {
const linkedWorkItem = {