fix(debug-mode): remove duplicate debug mode flag (#1714)

This commit is contained in:
Vikhyath Mondreti
2025-10-22 03:49:18 -07:00
committed by GitHub
parent 5ab482127d
commit 989a77261c
8 changed files with 15 additions and 42 deletions

View File

@@ -57,7 +57,7 @@ export const setupHandlerMocks = () => {
* Setup store mocks with configurable options
*/
export const setupStoreMocks = (options?: {
isDebugModeEnabled?: boolean
isDebugging?: boolean
consoleAddFn?: ReturnType<typeof vi.fn>
consoleUpdateFn?: ReturnType<typeof vi.fn>
}) => {
@@ -66,15 +66,14 @@ export const setupStoreMocks = (options?: {
vi.doMock('@/stores/settings/general/store', () => ({
useGeneralStore: {
getState: () => ({
isDebugModeEnabled: options?.isDebugModeEnabled ?? false,
}),
getState: () => ({}),
},
}))
vi.doMock('@/stores/execution/store', () => ({
useExecutionStore: {
getState: () => ({
isDebugging: options?.isDebugging ?? false,
setIsExecuting: vi.fn(),
reset: vi.fn(),
setActiveBlocks: vi.fn(),
@@ -925,7 +924,7 @@ export const setupParallelTestMocks = (options?: {
* Sets up all standard mocks for executor tests
*/
export const setupAllMocks = (options?: {
isDebugModeEnabled?: boolean
isDebugging?: boolean
consoleAddFn?: ReturnType<typeof vi.fn>
consoleUpdateFn?: ReturnType<typeof vi.fn>
}) => {

View File

@@ -386,11 +386,11 @@ describe('Executor', () => {
* Debug mode tests
*/
describe('debug mode', () => {
it('should detect debug mode from settings', async () => {
it('should detect debug mode from execution store', async () => {
vi.resetModules()
vi.clearAllMocks()
setupAllMocks({ isDebugModeEnabled: true })
setupAllMocks({ isDebugging: true })
const { Executor } = await import('@/executor/index')
@@ -405,7 +405,7 @@ describe('Executor', () => {
vi.resetModules()
vi.clearAllMocks()
setupAllMocks({ isDebugModeEnabled: false })
setupAllMocks({ isDebugging: false })
const { Executor } = await import('@/executor/index')

View File

@@ -36,7 +36,6 @@ import { VirtualBlockUtils } from '@/executor/utils/virtual-blocks'
import type { SerializedBlock, SerializedWorkflow } from '@/serializer/types'
import { useExecutionStore } from '@/stores/execution/store'
import { useConsoleStore } from '@/stores/panel/console/store'
import { useGeneralStore } from '@/stores/settings/general/store'
const logger = createLogger('Executor')
@@ -217,7 +216,7 @@ export class Executor {
new GenericBlockHandler(),
]
this.isDebugging = useGeneralStore.getState().isDebugModeEnabled
this.isDebugging = useExecutionStore.getState().isDebugging
}
/**