Initial commit
This commit is contained in:
39
tests/views/5_pages/FreePacksPage.test.js
Normal file
39
tests/views/5_pages/FreePacksPage.test.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import {expect, describe, test, beforeEach} from 'vitest'
|
||||
import {mount} from '@vue/test-utils'
|
||||
import ServiceOfPacks from "@services/ServiceOfPacks.js"
|
||||
import {ApiOfPacks} from "@mocks/packs.js"
|
||||
import FreePacksPage from "@pages/FreePacks/index.vue"
|
||||
import { createStore } from "vuex"
|
||||
import { store as packs } from '@/store/modules/packs'
|
||||
|
||||
describe('test FreePacksPage', () => {
|
||||
|
||||
const apiOfPacks = new ApiOfPacks()
|
||||
const store = createStore({
|
||||
modules: {
|
||||
packs
|
||||
}
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
store.dispatch('packs/resetStore')
|
||||
})
|
||||
|
||||
const serviceOfPacks = new ServiceOfPacks(apiOfPacks, store)
|
||||
|
||||
test('exist test of FreePacksPage', async () => {
|
||||
|
||||
const wrapper = mount(FreePacksPage, {
|
||||
shallow: true,
|
||||
})
|
||||
|
||||
expect(wrapper.exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('Service serviceOfPacks should be a object', () => {
|
||||
expect(typeof serviceOfPacks).toBe('object')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
35
tests/views/5_pages/LastMachinesByPackNumPage.test.js
Normal file
35
tests/views/5_pages/LastMachinesByPackNumPage.test.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import {expect, describe, test} from 'vitest'
|
||||
import {mount} from '@vue/test-utils'
|
||||
import LastMachinesPackNum from "@pages/LastMachinesPackNum/index.vue"
|
||||
import { createStore } from "vuex"
|
||||
import { store as machines } from '@/store/modules/machines'
|
||||
import ServiceOfMachines from "@services/ServiceOfMachines"
|
||||
import {AdapterOfMachines} from "@mocks/machines.js"
|
||||
|
||||
describe('test LastMachinesPackNum page', () => {
|
||||
|
||||
const adapterOfMachines = new AdapterOfMachines()
|
||||
const store = createStore({
|
||||
modules: {
|
||||
machines
|
||||
}
|
||||
})
|
||||
|
||||
const serviceOfMachines = new ServiceOfMachines(adapterOfMachines, store)
|
||||
|
||||
test('exist test of LastMachinesPackNum', async () => {
|
||||
|
||||
const wrapper = mount(LastMachinesPackNum, {
|
||||
shallow: true,
|
||||
})
|
||||
|
||||
expect(wrapper.exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('Service serviceOfMachines should be a object', () => {
|
||||
expect(typeof serviceOfMachines).toBe('object')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
39
tests/views/5_pages/LastPacksPage.test.js
Normal file
39
tests/views/5_pages/LastPacksPage.test.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import {expect, describe, test, beforeEach} from 'vitest'
|
||||
import {mount} from '@vue/test-utils'
|
||||
import ServiceOfPacks from "@services/ServiceOfPacks.js"
|
||||
import {ApiOfPacks} from "@mocks/packs.js"
|
||||
import LastPacksPage from "@pages/LastPacks/index.vue"
|
||||
import { createStore } from "vuex"
|
||||
import { store as packs } from '@/store/modules/packs'
|
||||
|
||||
describe('test LastPacksPage', () => {
|
||||
|
||||
const apiOfPacks = new ApiOfPacks()
|
||||
const store = createStore({
|
||||
modules: {
|
||||
packs
|
||||
}
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
store.dispatch('packs/resetStore')
|
||||
})
|
||||
|
||||
const serviceOfPacks = new ServiceOfPacks(apiOfPacks, store)
|
||||
|
||||
test('exist test of LastPacksPage', async () => {
|
||||
|
||||
const wrapper = mount(LastPacksPage, {
|
||||
shallow: true,
|
||||
})
|
||||
|
||||
expect(wrapper.exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('Service serviceOfPacks should be a object', () => {
|
||||
expect(typeof serviceOfPacks).toBe('object')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user