Files
yhy-mager/frontend/src/views/ReleasesPanel.test.ts
xiewenjun 54c318c615
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled
feat: implement license platform business flows and delivery tooling
Add admin and customer interfaces, orders, signed activation and leases, protected package delivery, keyring verification, migrations, security controls, tests and deployment documentation.

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
2026-10-09 15:33:22 +08:00

14 lines
852 B
TypeScript

import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
import ReleasesPanel from './ReleasesPanel.vue'
describe('ReleasesPanel', () => {
it('shows validation error without sending an invalid publication', async () => {
const wrapper = mount(ReleasesPanel, { props: { products: [] }, global: { stubs: { ElButton: { template: '<button @click="$emit(\'click\')"><slot /></button>' }, ElSelect: true, ElOption: true, ElInput: true, ElTable: true, ElTableColumn: true, ElPagination: true }, directives: { loading: () => {} } } })
expect(wrapper.find('[role="alert"]').exists()).toBe(false)
await wrapper.findAll('button')[1]!.trigger('click')
expect(wrapper.find('[role="alert"]').text()).toContain('请选择产品')
expect(wrapper.find('input[type="file"]').attributes('aria-label')).toBe('版本文件')
})
})