{
test: /\.xml/,
type: 'asset/resource',
generator: {
filename: 'sitemap.xml',
},
},
{
test: /\.txt/,
type: 'asset/resource',
generator: {
filename: 'robots.txt',
},
}
tls: {
rejectUnauthorized: false
}
const transporter = nodemailer.createTransport({
host: 'smtp.mail.ru',
port: 465,
secure: true,
auth: {
user: 'почта',
pass: 'пароль',
},
tls: {
rejectUnauthorized: false
}
})
import { mount } from '@vue/test-utils'
beforeEach(() => {
wrapper = mount(MainView, {
global: {
plugins: [
createTestingPinia({
createSpy: vi.fn,
initialState: {
client: {
clientsData: [client]
}
}
})
]
}
})
})
it('openning modal window add', async () => {
expect(wrapper.find('.modal').exists()).toBe(false)
await wrapper.find('#add').trigger('click')
expect(wrapper.find('.modal').exists()).toBe(true)
})
})
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { shallowMount } from '@vue/test-utils'
import { createTestingPinia } from '@pinia/testing'
import MainView from '@/views/MainView.vue'
describe('MainView.vue', () => {
let wrapper: any
const client = {
id: 1,
firstName: 'test',
secondName: 'testov',
thirdName: 'testovich',
fullName: 'testov test testovich',
date: {
newDate: new Date(),
nowDate: Date.now()
},
edit: {
newEdit: new Date(),
nowEdit: Date.now()
},
contacts: [
{
block: {
name: 'component'
},
selectValue: '',
inputValue: ''
}
],
newdCreateDate: 'today',
newEditDate: 'today'
}
beforeEach(() => {
wrapper = shallowMount(MainView, {
global: {
plugins: [
createTestingPinia({
createSpy: vi.fn,
initialState: {
client: {
clientsData: [client]
}
}
})
]
}
})
})
it('renders properly', () => {
expect(wrapper.find('.modal').exists()).toBe(false)
})
})