This commit is contained in:
2026-10-19 17:56:31 +08:00
parent 5a46198bf0
commit 5c28cd7c79
84 changed files with 3356 additions and 3630 deletions
@@ -39,6 +39,20 @@ beforeEach(() => {
afterEach(() => { wrapper?.unmount(); wrapper = undefined; document.body.innerHTML = ''; vi.useRealTimers() })
describe('SailingCalendarView integrated workspace', () => {
it('keeps one create entry and defaults the sailing to the selected calendar date', async () => {
const view = await mountView()
expect(view.find('.detail-header button').exists()).toBe(false)
const createButtons = view.findAll('button').filter(button => button.text() === '新增单个船次')
expect(createButtons).toHaveLength(1)
const otherDate = view.findAll('.calendar-cell').find(cell => cell.get('.day-number').text() === '29')!
await otherDate.trigger('click')
await createButtons[0].trigger('click')
await flushPromises()
expect(document.querySelector('.el-dialog__title')?.textContent).toBe('新增船期')
const departurePicker = view.findAllComponents({ name: 'ElDatePicker' }).find(picker => picker.props('type') === 'datetime')!
expect(departurePicker.props('modelValue')).toBe('2026-09-29T10:00:00')
})
it('preserves keyword search, date selection and month navigation with the shared header', async () => {
const view = await mountView()
expect(view.get('h1').text()).toBe('船期日历')