mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
Address PR feedback: refactor browser tests for better type safety
This commit is contained in:
@@ -268,10 +268,11 @@ test.describe('Node library sidebar', () => {
|
||||
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('')
|
||||
expect(setting).toHaveProperty(['foo/', 'color'])
|
||||
expect(setting?.['foo/']).toBeDefined()
|
||||
expect(setting?.['foo/']?.color).not.toBeNull()
|
||||
expect(setting?.['foo/']?.color).not.toBeUndefined()
|
||||
expect(setting?.['foo/']?.color).not.toBe('')
|
||||
})
|
||||
|
||||
test('Can rename customized bookmark folder', async ({ comfyPage }) => {
|
||||
|
||||
@@ -182,7 +182,9 @@ test.describe('Workflows sidebar', () => {
|
||||
// Compare the exported workflow with the original
|
||||
expect(downloadedContent).toBeDefined()
|
||||
expect(downloadedContentZh).toBeDefined()
|
||||
if (!downloadedContent || !downloadedContentZh) return
|
||||
if (!downloadedContent || !downloadedContentZh) {
|
||||
throw new Error('Downloaded workflow content is undefined')
|
||||
}
|
||||
delete downloadedContent.id
|
||||
delete downloadedContentZh.id
|
||||
expect(downloadedContent).toEqual(downloadedContentZh)
|
||||
|
||||
Reference in New Issue
Block a user