优化
This commit is contained in:
@@ -27,7 +27,9 @@ describe('DashboardView', () => {
|
||||
expect(wrapper.text()).toContain('核心指标来自实时业务数据')
|
||||
expect(wrapper.text()).toContain('数据更新时间:2026-09-11 12:00')
|
||||
expect(wrapper.findAll('.dashboard-metric')).toHaveLength(4)
|
||||
expect(wrapper.findAll('.density-fields dt').map(label => label.text())).toEqual(['今日新运单', '在途柜量', '活跃客户', '待清关票数'])
|
||||
expect(wrapper.findAll('.dashboard-metric p').map(label => label.text())).toEqual(['今日新运单', '在途柜量', '活跃客户', '待清关票数'])
|
||||
expect(wrapper.find('.density-fields').exists()).toBe(false)
|
||||
expect(wrapper.findAll('.dashboard-metric-mark')).toHaveLength(4)
|
||||
expect(wrapper.text()).toContain('12 票')
|
||||
expect(wrapper.text()).toContain('4.25 TEU')
|
||||
expect(wrapper.text()).toContain('8 家')
|
||||
@@ -46,7 +48,7 @@ describe('DashboardView', () => {
|
||||
const wrapper = mount(DashboardView)
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('部分核心指标加载失败')
|
||||
expect(wrapper.get('.dashboard-metric dd').text()).toContain('—')
|
||||
expect(wrapper.get('.dashboard-metric strong').text()).toContain('—')
|
||||
expect(wrapper.text()).toContain('4.25 TEU')
|
||||
await wrapper.findAll('button').find(button => button.text().trim() === '刷新数据')!.trigger('click')
|
||||
await flushPromises()
|
||||
@@ -55,7 +57,7 @@ describe('DashboardView', () => {
|
||||
expect(wrapper.text()).toContain('12 票')
|
||||
})
|
||||
|
||||
it('uses the same density-enabled root when entering and exiting fullscreen', async () => {
|
||||
it('uses the same visualization root when entering and exiting fullscreen', async () => {
|
||||
const wrapper = mount(DashboardView)
|
||||
await flushPromises()
|
||||
let fullscreen: Element | null = null
|
||||
@@ -67,7 +69,7 @@ describe('DashboardView', () => {
|
||||
Object.defineProperty(document, 'fullscreenElement', { configurable: true, get: () => fullscreen })
|
||||
Object.defineProperty(document, 'exitFullscreen', { configurable: true, value: exit })
|
||||
try {
|
||||
expect(wrapper.classes()).toContain('admin-density')
|
||||
expect(wrapper.classes()).not.toContain('admin-density')
|
||||
const button = wrapper.get('button[aria-pressed]')
|
||||
await button.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
Reference in New Issue
Block a user