mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 16:40:05 +00:00
nit
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { test as base } from '@playwright/test'
|
||||
|
||||
import type { StatusWsMessage } from '../../src/schemas/apiSchema'
|
||||
|
||||
export type WsMessage = { type: 'status'; data: StatusWsMessage }
|
||||
|
||||
export const webSocketFixture = base.extend<{
|
||||
ws: { trigger(data: any, url?: string): Promise<void> }
|
||||
ws: { trigger(data: WsMessage, url?: string): Promise<void> }
|
||||
}>({
|
||||
ws: [
|
||||
async ({ page }, use) => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Response } from '@playwright/test'
|
||||
import { expect, mergeTests } from '@playwright/test'
|
||||
|
||||
import type { StatusWsMessage } from '../../src/schemas/apiSchema.ts'
|
||||
import { comfyPageFixture } from '../fixtures/ComfyPage.ts'
|
||||
import { webSocketFixture } from '../fixtures/ws.ts'
|
||||
import { comfyPageFixture } from '../fixtures/ComfyPage'
|
||||
import { webSocketFixture } from '../fixtures/ws'
|
||||
import type { WsMessage } from '../fixtures/ws'
|
||||
|
||||
const test = mergeTests(comfyPageFixture, webSocketFixture)
|
||||
|
||||
@@ -61,7 +61,7 @@ test.describe('Actionbar', () => {
|
||||
|
||||
// Trigger a status websocket message
|
||||
const triggerStatus = async (queueSize: number) => {
|
||||
await ws.trigger({
|
||||
const message = {
|
||||
type: 'status',
|
||||
data: {
|
||||
status: {
|
||||
@@ -70,7 +70,9 @@ test.describe('Actionbar', () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
} as StatusWsMessage)
|
||||
} satisfies WsMessage
|
||||
|
||||
await ws.trigger(message)
|
||||
}
|
||||
|
||||
// Extract the width from the queue response
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { expect, mergeTests } from '@playwright/test'
|
||||
|
||||
import type { ComfyPage } from '../../fixtures/ComfyPage'
|
||||
import type { StatusWsMessage } from '../../../src/schemas/apiSchema'
|
||||
import { comfyPageFixture } from '../../fixtures/ComfyPage'
|
||||
import { webSocketFixture } from '../../fixtures/ws'
|
||||
import type { WsMessage } from '../../fixtures/ws'
|
||||
|
||||
const test = mergeTests(comfyPageFixture, webSocketFixture)
|
||||
|
||||
@@ -23,7 +23,7 @@ type QueueJob = [
|
||||
type QueueController = {
|
||||
state: QueueState
|
||||
sync: (
|
||||
ws: { trigger(data: any, url?: string): Promise<void> },
|
||||
ws: { trigger(data: WsMessage, url?: string): Promise<void> },
|
||||
nextState: Partial<QueueState>
|
||||
) => Promise<void>
|
||||
}
|
||||
@@ -134,7 +134,7 @@ const createQueueController = async (
|
||||
})
|
||||
|
||||
const sync = async (
|
||||
ws: { trigger(data: any, url?: string): Promise<void> },
|
||||
ws: { trigger(data: WsMessage, url?: string): Promise<void> },
|
||||
nextState: Partial<QueueState>
|
||||
) => {
|
||||
if (nextState.running) state.running = nextState.running
|
||||
@@ -148,7 +148,7 @@ const createQueueController = async (
|
||||
data: {
|
||||
status: { exec_info: { queue_remaining: total } }
|
||||
}
|
||||
} as StatusWsMessage)
|
||||
})
|
||||
|
||||
await queueResponse
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user