style: 优化单次生成设置布局
This commit is contained in:
1 parent
7691346132
commit
90c67e1aa8
5 files changed
+244
-95
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { NSelect } from 'naive-ui'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import GenerationModelControls from '../../../src/features/generation-config/components/GenerationModelControls.vue'
|
||||
import type { GenerationModelCatalog } from '../../../src/features/generation-config/types'
|
||||
@@ -40,6 +41,14 @@ const catalog: GenerationModelCatalog = {
|
||||
}
|
||||
|
||||
describe('单次生成模型控件', () => {
|
||||
it('字段采用双列栅格,控件与说明文字纵向排列并在移动端回落单列', () => {
|
||||
const source = readFileSync('src/features/generation-config/components/GenerationModelControls.vue', 'utf8')
|
||||
expect(source).toContain('class="generation-model-field-control"')
|
||||
expect(source).toMatch(/\.generation-model-controls\s*\{[^}]*grid-cols-\[repeat\(2,_minmax\(0,_1fr\)\)\]/)
|
||||
expect(source).toMatch(/\.generation-model-field-control\s*\{[^}]*flex-col[^}]*gap-1\.5/)
|
||||
expect(source).toMatch(/@media \(max-width: 760px\)[\s\S]*?grid-cols-\[minmax\(0,_1fr\)\]/)
|
||||
})
|
||||
|
||||
it('切换图片模型时只使用目标模型 defaults,不保留上一个模型参数', async () => {
|
||||
const wrapper = mount(GenerationModelControls, {
|
||||
props: {
|
||||
|
||||
Reference in new issue
Block a user