feat(feat(init): serviceOfMachines):
This commit is contained in:
@@ -1,2 +1,22 @@
|
||||
import {describe, test, expect} from 'vitest'
|
||||
import AdapterOfMachines from "@adapters/AdapterOfMachines.js"
|
||||
import {de} from 'vitest'
|
||||
import axios from 'axios'
|
||||
import {apiModalListMachines, appModalListMachines} from "@mocks/machines.js"
|
||||
|
||||
vi.mock('axios')
|
||||
|
||||
|
||||
describe('AdapterOfMachines', () => {
|
||||
axios.post.mockResolvedValue({data: apiModalListMachines})
|
||||
|
||||
test('AdapterOfMachines should be a object', () => {
|
||||
const adapterOfMachines = new AdapterOfMachines('')
|
||||
expect(typeof adapterOfMachines).toBe('object')
|
||||
})
|
||||
|
||||
test('test of fetchMachines', async () => {
|
||||
const adapterOfMachines = new AdapterOfMachines('http://localhost:5444')
|
||||
const result = await adapterOfMachines.getModalMachines()
|
||||
expect(result).toEqual(appModalListMachines)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user