feat(feat(init): serviceOfMachines):

This commit is contained in:
2024-03-26 16:03:24 +03:00
parent 6eb9973b61
commit f6ca446f92
22 changed files with 4644 additions and 458 deletions

View File

@@ -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)
})
})