fix: tests - useModels with remote models filter
This commit is contained in:
parent
8129c2319f
commit
895c3d4246
@ -1,5 +1,4 @@
|
|||||||
import JanModelExtension from './index'
|
import JanModelExtension from './index'
|
||||||
import { Model } from '@janhq/core'
|
|
||||||
|
|
||||||
let SETTINGS = []
|
let SETTINGS = []
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -72,7 +71,7 @@ describe('JanModelExtension', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should update a model', async () => {
|
it('should update a model', async () => {
|
||||||
const model: Partial<Model> = { id: 'test-model' }
|
const model = { id: 'test-model' }
|
||||||
const updatedModel = await extension.updateModel(model)
|
const updatedModel = await extension.updateModel(model)
|
||||||
expect(updatedModel).toEqual({})
|
expect(updatedModel).toEqual({})
|
||||||
expect(mockCortexAPI.updateModel).toHaveBeenCalledWith(model)
|
expect(mockCortexAPI.updateModel).toHaveBeenCalledWith(model)
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
// useModels.test.ts
|
// useModels.test.ts
|
||||||
|
|
||||||
import { renderHook, act } from '@testing-library/react'
|
import { renderHook, act } from '@testing-library/react'
|
||||||
import { events, ModelEvent, ModelManager } from '@janhq/core'
|
import { events, ModelEvent, ModelManager } from '@janhq/core'
|
||||||
import { extensionManager } from '@/extension'
|
import { extensionManager } from '@/extension'
|
||||||
@ -28,7 +27,9 @@ describe('useModels', () => {
|
|||||||
;(ModelManager.instance as jest.Mock).mockReturnValue({
|
;(ModelManager.instance as jest.Mock).mockReturnValue({
|
||||||
models: {
|
models: {
|
||||||
values: () => ({
|
values: () => ({
|
||||||
toArray: () => {},
|
toArray: () => ({
|
||||||
|
filter: () => models,
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user