mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-24 08:44:06 +00:00
- Rename dragAndDrop to dragDrop (7 occurrences) - Add override modifiers in SidebarTab.ts (4 fixes) - Remove .ts import extensions in actionbar.spec.ts - Prefix unused variables with underscore (9 files) - Fix ESLint import() type annotation in globals.d.ts Reduces typecheck:browser errors from 229 to 215 Amp-Thread-ID: https://ampcode.com/threads/T-019c1787-c781-761d-b95a-4844e909e64c Co-authored-by: Amp <amp@ampcode.com>
21 lines
600 B
TypeScript
21 lines
600 B
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
export class SettingsHelper {
|
|
constructor(private readonly page: Page) {}
|
|
|
|
async setSetting(settingId: string, settingValue: unknown): Promise<void> {
|
|
await this.page.evaluate(
|
|
async ({ id, value }) => {
|
|
await window.app!.extensionManager.setting.set(id, value)
|
|
},
|
|
{ id: settingId, value: settingValue }
|
|
)
|
|
}
|
|
|
|
async getSetting<T = unknown>(settingId: string): Promise<T> {
|
|
return await this.page.evaluate(async (id) => {
|
|
return await window.app!.extensionManager.setting.get(id)
|
|
}, settingId)
|
|
}
|
|
}
|