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

@@ -0,0 +1,19 @@
import axios from 'axios'
import {describe, test, expect, vi} from 'vitest'
import {apiModalListMachines} from "@mocks/machines.js"
import {scandApiRequest} from "@helpers/apiHelpers.js"
vi.mock('axios')
describe('scandApiRequest', () => {
test('scandApiRequest should be a function', () => {
expect(typeof scandApiRequest).toBe('function')
})
test('scandApiRequest should return a promise', async () => {
axios.post.mockResolvedValue({data: apiModalListMachines})
const result = await scandApiRequest('ScandApi.LiveMonitor.Machines', 'select_machines', [])
expect(result).toEqual(apiModalListMachines)
})
})