This commit is contained in:
2026-08-14 10:09:51 +08:00
parent 3598dd0a80
commit 87c6d2c4ca
5 changed files with 132 additions and 24 deletions
+11 -1
View File
@@ -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; }')
})
})