style: 恢复标签页分隔线并统一工具栏与图标按钮
This commit is contained in:
1 parent
370e7bb4a6
commit
2ddd9b8009
11 files changed
+203
-33
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { computed, nextTick, ref } from 'vue'
|
||||
import { NImage, NScrollbar } from 'naive-ui'
|
||||
import { NImage, NRadioGroup, NScrollbar } from 'naive-ui'
|
||||
import { createMemoryHistory, createRouter } from 'vue-router'
|
||||
import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
@@ -223,6 +223,28 @@ describe('内容级滚动下的生产反馈', () => {
|
||||
})
|
||||
|
||||
describe('视觉风格与主体身份工作区', () => {
|
||||
it.each([
|
||||
{ locked: null, label: '尚未创建', action: 'AI 生成风格', disabled: false },
|
||||
{ locked: false, label: '未锁定', action: 'AI 重新生成风格', disabled: false },
|
||||
{ locked: true, label: '已锁定', action: 'AI 重新生成风格', disabled: true }
|
||||
])('视觉风格 $label 使用独立状态说明与等高操作按钮,保留锁定限制', async ({ locked, label, action, disabled }) => {
|
||||
const fetcher = vi
|
||||
.fn<typeof fetch>()
|
||||
.mockImplementation(async () => jsonResponse(locked === null ? null : styleFixture({ isLocked: locked })))
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
await mountAssets('style')
|
||||
const status = wrapper!.get('.visual-style-status')
|
||||
expect(status.attributes('role')).toBe('status')
|
||||
expect(status.get('strong').text()).toBe(label)
|
||||
expect(status.find('button').exists()).toBe(false)
|
||||
expect(wrapper!.find('.visual-style-toolbar .n-tag').exists()).toBe(false)
|
||||
expect(wrapper!.get('.visual-style-actions').findAll('button')).toHaveLength(2)
|
||||
expect(button(action).disabled).toBe(disabled)
|
||||
expect(button(action).style.getPropertyValue('--n-height')).toBe('34px')
|
||||
expect(button('刷新风格').style.getPropertyValue('--n-height')).toBe('34px')
|
||||
expect(fetcher.mock.calls.every(([, options]) => !options?.method || options.method === 'GET')).toBe(true)
|
||||
})
|
||||
|
||||
it('主体目录显示已确认母版和默认占位,点缩略图只切换主体,不重复读取所有角色图库', async () => {
|
||||
const first = formFixture()
|
||||
const forms = [
|
||||
@@ -1326,6 +1348,11 @@ describe('工作台页面交互', () => {
|
||||
await router.push('/')
|
||||
wrapper = mount(ProjectsPage, { attachTo: document.body, global: { plugins: [router] } })
|
||||
await flushPromises()
|
||||
expect(wrapper.getComponent(NRadioGroup).props('size')).toBe('medium')
|
||||
const refresh = wrapper.get('[aria-label="刷新项目"]')
|
||||
expect(refresh.classes()).toContain('icon-button')
|
||||
expect(refresh.find('.n-button__icon svg').exists()).toBe(true)
|
||||
expect(refresh.text()).toBe('')
|
||||
expect(wrapper.text()).toContain('雨夜来信')
|
||||
await wrapper.get('input[aria-label="搜索项目"]').setValue('不存在的关键词')
|
||||
expect(wrapper.text()).toContain('没有匹配的剧本')
|
||||
|
||||
Reference in new issue
Block a user