mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-05 13:41:59 +00:00
fix(browser_tests): remove all @ts-expect-error and type assertions
This commit is contained in:
@@ -265,13 +265,13 @@ test.describe('Node library sidebar', () => {
|
||||
await comfyPage.nextFrame()
|
||||
|
||||
// Verify the color selection is saved
|
||||
const setting = await comfyPage.getSetting(
|
||||
const setting = (await comfyPage.getSetting(
|
||||
'Comfy.NodeLibrary.BookmarksCustomization'
|
||||
)
|
||||
)) as Record<string, { icon?: string; color?: string }> | undefined
|
||||
await expect(setting).toHaveProperty(['foo/', 'color'])
|
||||
await expect(setting['foo/'].color).not.toBeNull()
|
||||
await expect(setting['foo/'].color).not.toBeUndefined()
|
||||
await expect(setting['foo/'].color).not.toBe('')
|
||||
await expect(setting?.['foo/'].color).not.toBeNull()
|
||||
await expect(setting?.['foo/'].color).not.toBeUndefined()
|
||||
await expect(setting?.['foo/'].color).not.toBe('')
|
||||
})
|
||||
|
||||
test('Can rename customized bookmark folder', async ({ comfyPage }) => {
|
||||
|
||||
@@ -139,12 +139,15 @@ test.describe('Workflows sidebar', () => {
|
||||
api: false
|
||||
})
|
||||
expect(exportedWorkflow).toBeDefined()
|
||||
for (const node of exportedWorkflow.nodes) {
|
||||
for (const slot of node.inputs) {
|
||||
if (!exportedWorkflow) return
|
||||
const nodes = exportedWorkflow.nodes
|
||||
if (!Array.isArray(nodes)) return
|
||||
for (const node of nodes) {
|
||||
for (const slot of node.inputs ?? []) {
|
||||
expect(slot.localized_name).toBeUndefined()
|
||||
expect(slot.label).toBeUndefined()
|
||||
}
|
||||
for (const slot of node.outputs) {
|
||||
for (const slot of node.outputs ?? []) {
|
||||
expect(slot.localized_name).toBeUndefined()
|
||||
expect(slot.label).toBeUndefined()
|
||||
}
|
||||
@@ -177,9 +180,11 @@ test.describe('Workflows sidebar', () => {
|
||||
})
|
||||
|
||||
// Compare the exported workflow with the original
|
||||
expect(downloadedContent).toBeDefined()
|
||||
expect(downloadedContentZh).toBeDefined()
|
||||
if (!downloadedContent || !downloadedContentZh) return
|
||||
delete downloadedContent.id
|
||||
delete downloadedContentZh.id
|
||||
expect(downloadedContent).toBeDefined()
|
||||
expect(downloadedContent).toEqual(downloadedContentZh)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user