Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Sep 19, 2024
1 parent 52ae2ff commit e821b12
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests-ui/tests/nodeSearchService.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { NodeSearchService } from '@/services/nodeSearchService'
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
import { plainToClass } from 'class-transformer'
import { mockNodeDefStore } from '../utils/setup'

const EXAMPLE_NODE_DEFS: ComfyNodeDefImpl[] = [
{
Expand Down Expand Up @@ -52,11 +51,14 @@ const EXAMPLE_NODE_DEFS: ComfyNodeDefImpl[] = [
category: 'latent/batch',
output_node: false
}
].map((nodeDef) => plainToClass(ComfyNodeDefImpl, nodeDef))
].map((nodeDef) => {
const def = plainToClass(ComfyNodeDefImpl, nodeDef)
def['postProcessSearchScores'] = (s) => s
return def
})

describe('nodeSearchService', () => {
it('searches with input filter', () => {
mockNodeDefStore()
const service = new NodeSearchService(EXAMPLE_NODE_DEFS)
const inputFilter = service.getFilterById('input')
expect(service.searchNode('L', [[inputFilter, 'LATENT']])).toHaveLength(1)
Expand Down

0 comments on commit e821b12

Please sign in to comment.