优化
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import { beforeEach, describe, expect, it } from 'vitest'
|
||||
import QueryToolbar, { type QueryField } from './QueryToolbar.vue'
|
||||
@@ -59,5 +61,13 @@ describe('QueryToolbar layout preferences', () => {
|
||||
expect(wrapper.findAll('input').map((input) => input.attributes('data-placeholder')))
|
||||
.toEqual(['创建日期', '状态', '关键词'])
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps desktop actions grouped with the final filter when the toolbar wraps', () => {
|
||||
const wrapper = mountToolbar()
|
||||
expect(wrapper.find('.query-toolbar__tail input').attributes('data-placeholder')).toBe('创建日期')
|
||||
expect(wrapper.find('.query-toolbar__tail .query-toolbar__actions').exists()).toBe(true)
|
||||
|
||||
const source = readFileSync(resolve(process.cwd(), 'src/shared/components/QueryToolbar.vue'), 'utf8')
|
||||
expect(source).toContain('.query-toolbar__tail { display: flex; align-items: flex-end; width: auto; flex: 0 0 auto; gap: 10px; }')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user