updated Service of Users, updated tests
This commit is contained in:
@@ -14,53 +14,11 @@ import {
|
||||
} from '@services/serviceOfUsers/helpers.js'
|
||||
import { createStore } from 'vuex'
|
||||
import {store as users} from "@/store/modules/users"
|
||||
import axios from "axios";
|
||||
import axios from "axios"
|
||||
import {defaultUsers} from "@mocks/users"
|
||||
|
||||
vi.mock('axios')
|
||||
|
||||
const defaultUsers = [
|
||||
{
|
||||
"id": 1,
|
||||
"serviceId": [1, 3],
|
||||
"firstName": "Leanne 1",
|
||||
"lastName": "Graham",
|
||||
"email": "test@mail.ru",
|
||||
"role": "admin",
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"serviceId": [1],
|
||||
"firstName": "Leanne 2",
|
||||
"lastName": "Graham",
|
||||
"email": "test@mail.ru",
|
||||
"role": "admin",
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"serviceId": [2, 3],
|
||||
"firstName": "Leanne 3",
|
||||
"lastName": "Graham",
|
||||
"email": "test@mail.ru",
|
||||
"role": "admin",
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"serviceId": [3],
|
||||
"firstName": "Leanne 4",
|
||||
"lastName": "Graham",
|
||||
"email": "test@mail.ru",
|
||||
"role": "admin",
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"serviceId": [4, 5],
|
||||
"firstName": "Leanne 5",
|
||||
"lastName": "Graham",
|
||||
"email": "test@mail.ru",
|
||||
"role": "admin",
|
||||
},
|
||||
]
|
||||
|
||||
describe("tests services of users", () => {
|
||||
const store = createStore({
|
||||
plugins: [],
|
||||
@@ -103,7 +61,7 @@ describe("tests services of users", () => {
|
||||
test('Added new user layout to user editor', async () => {
|
||||
const newUser = {id: -1, firstName: '',lastName: '', role: '', email: '', password: '', serviceId: []}
|
||||
|
||||
const expectUser = await serviceOfUsers.createNewUser()
|
||||
const expectUser = await serviceOfUsers.addNewUser()
|
||||
|
||||
expect({newUser: expectUser}).toEqual({newUser})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user