[PR #984] [MERGED] [Test] Centralise common mocks #1260

Closed
opened 2026-10-31 22:20:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/desktop/pull/984
Author: @webfiltered
Created: 2/23/2025
Status: ✅ Merged
Merged: 2/23/2025
Merged by: @webfiltered

Base: main ← Head: test-centralise-mocks


📝 Commits (6)

  • 058c6db [Refactor] Centralise common mocks to setup.ts
  • ae54403 [Cleanup] Resolve test workaround
  • 4ae1e02 [Refactor] Remove most one-off electron mocks
  • a9037ac [Test] Refactor AppHandlers tests
  • 0e3d5d3 [Test] Update cursor rules to include setup.ts behaviour
  • 4edb41d nit

📊 Changes

15 files changed (+129 additions, -213 deletions)

View changed files

📝 .cursor/rules/vitest.mdc (+1 -0)
📝 tests/unit/config/comfyServerConfig.test.ts (+0 -6)
📝 tests/unit/desktopApp.test.ts (+0 -23)
📝 tests/unit/handlers/AppHandlers.test.ts (+16 -30)
📝 tests/unit/handlers/appinfoHandlers.test.ts (+1 -13)
📝 tests/unit/handlers/pathHandler.test.ts (+17 -30)
📝 tests/unit/install/installWizard.test.ts (+14 -17)
📝 tests/unit/install/installationManager.test.ts (+0 -11)
📝 tests/unit/main-process/appState.test.ts (+0 -7)
📝 tests/unit/main-process/appWindow.test.ts (+14 -14)
📝 tests/unit/main-process/comfyDesktopApp.test.ts (+0 -10)
📝 tests/unit/main-process/comfyServer.test.ts (+1 -5)
📝 tests/unit/services/telemetry.test.ts (+2 -24)
📝 tests/unit/setup.ts (+52 -4)
📝 tests/unit/store/desktopConfig.test.ts (+11 -19)

📄 Description

  • Creates shared mocks in setup.ts
  • Shared mocks may be extended (see appWindow.test.ts)
  • Refactors AppHandlers - required with changes to app.quit
  • Updates cursor rules to reflect changes

┆Issue is synchronized with this Notion page by Unito


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/desktop/pull/984 **Author:** [@webfiltered](https://github.com/webfiltered) **Created:** 2/23/2025 **Status:** ✅ Merged **Merged:** 2/23/2025 **Merged by:** [@webfiltered](https://github.com/webfiltered) **Base:** `main` ← **Head:** `test-centralise-mocks` --- ### 📝 Commits (6) - [`058c6db`](https://github.com/Comfy-Org/desktop/commit/058c6dbe9479d1c7b52c79833d07f869cb2ff72b) [Refactor] Centralise common mocks to setup.ts - [`ae54403`](https://github.com/Comfy-Org/desktop/commit/ae54403929ef3323437c4ab752c703567e3dc83a) [Cleanup] Resolve test workaround - [`4ae1e02`](https://github.com/Comfy-Org/desktop/commit/4ae1e02d8516009a137708da1d5bf90a1fa240bb) [Refactor] Remove most one-off electron mocks - [`a9037ac`](https://github.com/Comfy-Org/desktop/commit/a9037acad678969820fa595761c24fd7ffe5c051) [Test] Refactor AppHandlers tests - [`0e3d5d3`](https://github.com/Comfy-Org/desktop/commit/0e3d5d3901ea0c9852abfda52f582849c63b9b51) [Test] Update cursor rules to include setup.ts behaviour - [`4edb41d`](https://github.com/Comfy-Org/desktop/commit/4edb41de2c8b95be5e4dfdf5ce2ba10d0ff68e19) nit ### 📊 Changes **15 files changed** (+129 additions, -213 deletions) <details> <summary>View changed files</summary> 📝 `.cursor/rules/vitest.mdc` (+1 -0) 📝 `tests/unit/config/comfyServerConfig.test.ts` (+0 -6) 📝 `tests/unit/desktopApp.test.ts` (+0 -23) 📝 `tests/unit/handlers/AppHandlers.test.ts` (+16 -30) 📝 `tests/unit/handlers/appinfoHandlers.test.ts` (+1 -13) 📝 `tests/unit/handlers/pathHandler.test.ts` (+17 -30) 📝 `tests/unit/install/installWizard.test.ts` (+14 -17) 📝 `tests/unit/install/installationManager.test.ts` (+0 -11) 📝 `tests/unit/main-process/appState.test.ts` (+0 -7) 📝 `tests/unit/main-process/appWindow.test.ts` (+14 -14) 📝 `tests/unit/main-process/comfyDesktopApp.test.ts` (+0 -10) 📝 `tests/unit/main-process/comfyServer.test.ts` (+1 -5) 📝 `tests/unit/services/telemetry.test.ts` (+2 -24) 📝 `tests/unit/setup.ts` (+52 -4) 📝 `tests/unit/store/desktopConfig.test.ts` (+11 -19) </details> ### 📄 Description - Creates shared mocks in `setup.ts` - Shared mocks may be extended (see `appWindow.test.ts`) - Refactors AppHandlers - required with changes to `app.quit` - Updates cursor rules to reflect changes ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-984-Test-Centralise-common-mocks-1a36d73d36508142a4fcfe1bfd31b80f) by [Unito](https://www.unito.io) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:20:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#1260
No description provided.