updated Service of Users, updated tests
This commit is contained in:
@@ -7,10 +7,10 @@ import {store as services} from "@/store/modules/services"
|
||||
import {store as users} from "@/store/modules/users"
|
||||
import AdapterOfServices from '@adapters/adapterOfServices/Services'
|
||||
import ServiceOfServices from '@services/serviceOfServices/Services.js'
|
||||
import {defaultServices, resServices} from "@mocks/services"
|
||||
|
||||
vi.mock('axios')
|
||||
|
||||
|
||||
describe("tests Services Manager Page component", () => {
|
||||
const store = createStore({
|
||||
plugins: [],
|
||||
@@ -20,38 +20,6 @@ describe("tests Services Manager Page component", () => {
|
||||
},
|
||||
})
|
||||
|
||||
const defaultServices = [
|
||||
{
|
||||
"id": 1,
|
||||
"created_at": "2024-03-06T17:31:31.948355541+03:00",
|
||||
"updated_at": "2024-03-06T17:31:31.948355541+03:00",
|
||||
"deleted_at": null,
|
||||
"name": "jsonplaceholder.typicode.com",
|
||||
"port": 9965,
|
||||
"proxy_ip": "172.25.78.153",
|
||||
"site_ip": "https://jsonplaceholder.typicode.com/",
|
||||
"internet_uri": "localhost",
|
||||
"description": "localhost",
|
||||
"is_online": true
|
||||
},
|
||||
]
|
||||
|
||||
const resServices = [
|
||||
{
|
||||
"id": 1,
|
||||
"createdAt": "2024-03-06T17:31:31.948355541+03:00",
|
||||
"updatedAt": "2024-03-06T17:31:31.948355541+03:00",
|
||||
"deletedAt": null,
|
||||
"name": "jsonplaceholder.typicode.com",
|
||||
"port": 9965,
|
||||
"proxyIp": "172.25.78.153",
|
||||
"deviceIp": "https://jsonplaceholder.typicode.com/",
|
||||
"internetUri": "localhost",
|
||||
"description": "localhost",
|
||||
"isOnline": true
|
||||
},
|
||||
]
|
||||
|
||||
axios.get.mockResolvedValue({
|
||||
data: defaultServices,
|
||||
})
|
||||
@@ -62,7 +30,9 @@ describe("tests Services Manager Page component", () => {
|
||||
test('Services Manager Page mounted with vuex', async () => {
|
||||
const wrapper = mount(Services, {
|
||||
global: {
|
||||
plugins: [store]
|
||||
mocks: {
|
||||
$store: store
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user