Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81f7bdf6ed |
@@ -75,7 +75,9 @@ describe('SmartLoadingWorkbenchView', () => {
|
|||||||
expect(wrapper.text()).not.toContain('LP-99')
|
expect(wrapper.text()).not.toContain('LP-99')
|
||||||
expect(wrapper.text()).toContain('IN-1')
|
expect(wrapper.text()).toContain('IN-1')
|
||||||
expect(wrapper.text()).not.toContain('ORD-1')
|
expect(wrapper.text()).not.toContain('ORD-1')
|
||||||
expect(wrapper.text()).toContain('150% 容量上限')
|
expect(wrapper.text()).not.toContain('150% 容量上限')
|
||||||
|
await wrapper.get('button[aria-label="查看装柜说明"]').trigger('mouseenter')
|
||||||
|
await vi.waitFor(() => expect(document.body.textContent).toContain('150% 容量上限'))
|
||||||
})
|
})
|
||||||
|
|
||||||
it('shows the full inbound composition for an assigned sealed pallet', async () => {
|
it('shows the full inbound composition for an assigned sealed pallet', async () => {
|
||||||
|
|||||||
@@ -235,11 +235,13 @@ describe('InboundFeePanel', () => {
|
|||||||
|
|
||||||
it('treats A0404 as a neutral not-yet-generated state', async () => {
|
it('treats A0404 as a neutral not-yet-generated state', async () => {
|
||||||
vi.mocked(getLatestInboundFee).mockRejectedValue(new ApiResponseError('费用快照不存在', 'A0404'))
|
vi.mocked(getLatestInboundFee).mockRejectedValue(new ApiResponseError('费用快照不存在', 'A0404'))
|
||||||
mountPanel(['firstleg:fba-pricing:view'])
|
const wrapper = mountPanel(['firstleg:fba-pricing:view'])
|
||||||
await flushPromises()
|
await flushPromises()
|
||||||
|
|
||||||
expect(document.body.textContent).toContain('尚未生成费用快照')
|
expect(document.body.textContent).toContain('尚未生成费用快照')
|
||||||
expect(document.body.textContent).toContain('测量审核完成后')
|
expect(document.body.textContent).not.toContain('测量审核完成后')
|
||||||
|
await wrapper.get('button[aria-label="查看计费说明"]').trigger('mouseenter')
|
||||||
|
await vi.waitFor(() => expect(document.body.textContent).toContain('测量审核完成后'))
|
||||||
expect(document.querySelector('[role="alert"]')).toBeNull()
|
expect(document.querySelector('[role="alert"]')).toBeNull()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
vi.mock('@/shared/components/AppDialog.vue', () => ({ default: { props: ['modelValue'], template: '<section v-if="modelValue"><slot /></section>' } }))
|
vi.mock('@/shared/components/AppDialog.vue', () => ({ default: { props: ['modelValue'], template: '<section v-if="modelValue"><slot /></section>' } }))
|
||||||
|
import ElementPlus from 'element-plus'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
import { defineComponent } from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
@@ -15,7 +16,7 @@ function data(status = 'COMPLETE'): DailyResponse {
|
|||||||
}
|
}
|
||||||
describe('SKU daily trend axes', () => {
|
describe('SKU daily trend axes', () => {
|
||||||
it('shows both axes, intermediate dates, zero and maximum ticks for a 30-day window', () => {
|
it('shows both axes, intermediate dates, zero and maximum ticks for a 30-day window', () => {
|
||||||
const w = mount(SkuTrend, { props: { data: data() } })
|
const w = mount(SkuTrend, { props: { data: data() }, global: { plugins: [ElementPlus] } })
|
||||||
const chart = w.findComponent({ name: 'VChart' })
|
const chart = w.findComponent({ name: 'VChart' })
|
||||||
const option = chart.props('option')
|
const option = chart.props('option')
|
||||||
expect(option.xAxis).toMatchObject({ type: 'category', name: '日期(北京时间)' })
|
expect(option.xAxis).toMatchObject({ type: 'category', name: '日期(北京时间)' })
|
||||||
@@ -24,11 +25,11 @@ describe('SKU daily trend axes', () => {
|
|||||||
expect(option.series[1].data).toEqual(Array(30).fill(1))
|
expect(option.series[1].data).toEqual(Array(30).fill(1))
|
||||||
expect(option.tooltip.trigger).toBe('axis')
|
expect(option.tooltip.trigger).toBe('axis')
|
||||||
expect(chart.props('initOptions')).toEqual({ renderer: 'canvas' })
|
expect(chart.props('initOptions')).toEqual({ renderer: 'canvas' })
|
||||||
expect(w.find('svg').exists()).toBe(false)
|
expect(w.get('.sku-trend').find('svg').exists()).toBe(false)
|
||||||
w.unmount()
|
w.unmount()
|
||||||
})
|
})
|
||||||
it('retains axes and date markers for an unknown window without drawing zero points', () => {
|
it('retains axes and date markers for an unknown window without drawing zero points', () => {
|
||||||
const w = mount(SkuTrend, { props: { data: data('UNKNOWN') } })
|
const w = mount(SkuTrend, { props: { data: data('UNKNOWN') }, global: { plugins: [ElementPlus] } })
|
||||||
expect(w.text()).toContain('未知日期不作为零销量')
|
expect(w.text()).toContain('未知日期不作为零销量')
|
||||||
const option = w.findComponent({ name: 'VChart' }).props('option')
|
const option = w.findComponent({ name: 'VChart' }).props('option')
|
||||||
expect(option.series[0].data.every((point: { value: number | null }) => point.value === null)).toBe(true)
|
expect(option.series[0].data.every((point: { value: number | null }) => point.value === null)).toBe(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user