feat(web-admin): add arranged tab to transport plan list filters
Insert「已安排」after「待安排」in PL_PLAN_LIST_TABS and map it to followStatus=arranged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
87374f3976
commit
01946dde8e
2 files changed
+61
-4
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { describe, it } from 'node:test'
|
||||
import {
|
||||
PL_PLAN_LIST_TABS,
|
||||
isPlPlanFollowStatusListTab,
|
||||
plPlanListTabToFilters
|
||||
} from './pl-display'
|
||||
|
||||
describe('PL_PLAN_LIST_TABS', () => {
|
||||
it('places arranged immediately after pending_arrange', () => {
|
||||
const names = PL_PLAN_LIST_TABS.map((t) => t.name)
|
||||
assert.deepEqual(names.slice(0, 3), ['pending_arrange', 'arranged', 'drafting'])
|
||||
assert.equal(
|
||||
PL_PLAN_LIST_TABS.find((t) => t.name === 'arranged')?.label,
|
||||
'已安排'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('isPlPlanFollowStatusListTab', () => {
|
||||
it('recognizes pending_arrange, arranged, drafting', () => {
|
||||
assert.equal(isPlPlanFollowStatusListTab('pending_arrange'), true)
|
||||
assert.equal(isPlPlanFollowStatusListTab('arranged'), true)
|
||||
assert.equal(isPlPlanFollowStatusListTab('drafting'), true)
|
||||
assert.equal(isPlPlanFollowStatusListTab('all'), false)
|
||||
assert.equal(isPlPlanFollowStatusListTab('inbound'), false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('plPlanListTabToFilters', () => {
|
||||
it('maps arranged to followStatus arranged with empty planType', () => {
|
||||
assert.deepEqual(plPlanListTabToFilters('arranged'), {
|
||||
planType: '',
|
||||
followStatus: 'arranged'
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps pending_arrange and drafting behavior', () => {
|
||||
assert.deepEqual(plPlanListTabToFilters('pending_arrange'), {
|
||||
planType: '',
|
||||
followStatus: 'pending_arrange'
|
||||
})
|
||||
assert.deepEqual(plPlanListTabToFilters('drafting'), {
|
||||
planType: '',
|
||||
followStatus: 'drafting'
|
||||
})
|
||||
})
|
||||
|
||||
it('maps type tabs without followStatus', () => {
|
||||
assert.deepEqual(plPlanListTabToFilters('all'), { planType: '' })
|
||||
assert.deepEqual(plPlanListTabToFilters('inbound'), { planType: 'inbound' })
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user