mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
* Merge temp userfile Basic migration Remove deprecated isFavourite Rename nit nit Rework open/load Refactor save Refactor delete Remove workflow dep on manager WIP Change map to record Fix directory nit isActive Move nit Add unload Add close workflow Remove workflowManager.closeWorkflow nit Remove workflowManager.storePrompt move from commandStore move more from commandStore nit Use workflowservice nit nit implement setWorkflow nit Remove workflows.ts Fix strict errors nit nit Resolves circular dep nit nit Fix workflow switching Add openworkflowPaths Fix store Fix key Serialize by default Fix proxy nit Update path Proper sync Fix tabs WIP nit Resolve merge conflict Fix userfile store tests Update jest test Update tabs patch tests Fix changeTracker init Move insert to service nit Fix insert nit Handle bookmark rename Refactor tests Add delete workflow Add test on deleting workflow Add closeWorkflow tests nit * Fix path * Move load next/previous * Move logic from store to service * nit * nit * nit * nit * nit * Add ChangeTracker.initialState * ChangeTracker load/unload * Remove app.changeWorkflow * Hook to app.ts * Changetracker restore * nit * nit * nit * Add debug logs * Remove unnecessary checkState on graphLoad * nit * Fix strict * Fix temp workflow name * Track ismodified * Fix reactivity * nit * Fix graph equal * nit * update test * nit * nit * Fix modified state * nit * Fix modified state * Sidebar force close * tabs force close * Fix save * Add load remote workflow test * Force save * Add save test * nit * Correctly handle delete last opened workflow * nit * Fix workflow rename * Fix save * Fix tests * Fix strict * Update playwright tests * Fix filename conflict handling * nit * Merge temporary and persisted ref * Update playwright expectations * nit * nit * Fix saveAs * Add playwright test * nit
78 lines
1.7 KiB
TypeScript
78 lines
1.7 KiB
TypeScript
// @ts-strict-ignore
|
|
module.exports = async function () {
|
|
global.ResizeObserver = class ResizeObserver {
|
|
observe() {}
|
|
unobserve() {}
|
|
disconnect() {}
|
|
}
|
|
|
|
const { nop } = require('../utils/nopProxy')
|
|
global.enableWebGLCanvas = nop
|
|
|
|
HTMLCanvasElement.prototype.getContext = nop
|
|
|
|
localStorage['Comfy.Settings.Comfy.Logging.Enabled'] = 'false'
|
|
|
|
jest.mock('@/services/dialogService', () => {
|
|
return {
|
|
showLoadWorkflowWarning: jest.fn(),
|
|
showMissingModelsWarning: jest.fn(),
|
|
showSettingsDialog: jest.fn(),
|
|
showExecutionErrorDialog: jest.fn(),
|
|
showTemplateWorkflowsDialog: jest.fn(),
|
|
showPromptDialog: jest
|
|
.fn()
|
|
.mockImplementation((message, defaultValue) => {
|
|
return Promise.resolve(defaultValue)
|
|
})
|
|
}
|
|
})
|
|
|
|
jest.mock('@/stores/toastStore', () => {
|
|
return {
|
|
useToastStore: () => ({
|
|
addAlert: jest.fn()
|
|
})
|
|
}
|
|
})
|
|
|
|
jest.mock('@/stores/extensionStore', () => {
|
|
return {
|
|
useExtensionStore: () => ({
|
|
registerExtension: jest.fn(),
|
|
loadDisabledExtensionNames: jest.fn()
|
|
})
|
|
}
|
|
})
|
|
|
|
jest.mock('@/stores/workspaceStore', () => {
|
|
return {
|
|
useWorkspaceStore: () => ({
|
|
shiftDown: false,
|
|
spinner: false,
|
|
focusMode: false,
|
|
toggleFocusMode: jest.fn(),
|
|
workflow: {
|
|
activeWorkflow: null,
|
|
syncWorkflows: jest.fn(),
|
|
getWorkflowByPath: jest.fn(),
|
|
createTemporary: jest.fn(),
|
|
openWorkflow: jest.fn()
|
|
}
|
|
})
|
|
}
|
|
})
|
|
|
|
jest.mock('@/stores/workspace/bottomPanelStore', () => {
|
|
return {
|
|
toggleBottomPanel: jest.fn()
|
|
}
|
|
})
|
|
|
|
jest.mock('vue-i18n', () => {
|
|
return {
|
|
useI18n: jest.fn()
|
|
}
|
|
})
|
|
}
|