Problem
The browser tests currently contain 16 type assertions casting window.app!.extensionManager to WorkspaceStore. These casts are a workaround for incomplete type definitions.
Context
Proposed Approach
As mentioned by @DrJKL:
We need to fix and/or modularize some of the augmentation .d.ts files first, then be more selective about how we access internals in the tests.
Tasks
- Fix and/or modularize augmentation
.d.ts files in browser_tests/types/
- Improve type definitions for
window.app.extensionManager to properly expose WorkspaceStore properties
- Be more selective about accessing internal store properties in tests
- Eliminate all
as WorkspaceStore casts throughout the browser tests
Affected Files (16 occurrences)
browser_tests/types/globals.d.ts (1 in documentation)
browser_tests/tests/colorPalette.spec.ts (1)
browser_tests/tests/browserTabTitle.spec.ts (3)
browser_tests/tests/actionbar.spec.ts (1)
browser_tests/fixtures/components/Topbar.ts (1)
browser_tests/fixtures/components/SidebarTab.ts (1)
browser_tests/fixtures/helpers/WorkflowHelper.ts (4)
browser_tests/fixtures/ComfyPage.ts (2)
browser_tests/helpers/actionbar.ts (2)
Benefits
- Improved type safety
- Better autocomplete support
- Reduced maintenance burden
- Clearer test code without workaround casts
┆Issue is synchronized with this Notion page by Unito
Problem
The browser tests currently contain 16 type assertions casting
window.app!.extensionManagertoWorkspaceStore. These casts are a workaround for incomplete type definitions.Context
Proposed Approach
As mentioned by @DrJKL:
Tasks
.d.tsfiles inbrowser_tests/types/window.app.extensionManagerto properly expose WorkspaceStore propertiesas WorkspaceStorecasts throughout the browser testsAffected Files (16 occurrences)
browser_tests/types/globals.d.ts(1 in documentation)browser_tests/tests/colorPalette.spec.ts(1)browser_tests/tests/browserTabTitle.spec.ts(3)browser_tests/tests/actionbar.spec.ts(1)browser_tests/fixtures/components/Topbar.ts(1)browser_tests/fixtures/components/SidebarTab.ts(1)browser_tests/fixtures/helpers/WorkflowHelper.ts(4)browser_tests/fixtures/ComfyPage.ts(2)browser_tests/helpers/actionbar.ts(2)Benefits
┆Issue is synchronized with this Notion page by Unito