|
|
@@ -57,6 +57,13 @@ test('market list visual contract keeps search white, tags filled and actions ri
|
|
|
assert.match(styles, /\.market-list__filters\s*\{[\s\S]*?background:\s*#fff;/)
|
|
|
assert.match(styles, /\.presign-order-page__search\s*\{[\s\S]*?top:\s*0;/)
|
|
|
assert.match(styles, /\.market-list-card__actions\s*\{[\s\S]*?justify-content:\s*flex-end;/)
|
|
|
+ assert.match(styles, /\.market-list-card__actions \.van-button\s*\{[\s\S]*?padding:\s*0 8px;/)
|
|
|
+ const listCard = source('./components/MarketListCard.vue')
|
|
|
+ assert.doesNotMatch(listCard, /#icon/)
|
|
|
+ assert.doesNotMatch(listCard, /actionIcon/)
|
|
|
+ const presignCard = source('./components/PresignOrderCard.vue')
|
|
|
+ assert.doesNotMatch(presignCard, /icon="edit"/)
|
|
|
+ assert.doesNotMatch(presignCard, /icon="delete-o"/)
|
|
|
assert.match(styles, /\.presign-order-card__actions\s*\{[\s\S]*?justify-content:\s*flex-end;/)
|
|
|
assert.match(styles, /\.market-tag\s*\{[\s\S]*?align-self:\s*flex-start;/)
|
|
|
assert.match(styles, /\.market-tag\s*\{[\s\S]*?max-width:\s*128px;/)
|
|
|
@@ -123,6 +130,86 @@ test('market lists expose a mobile filter sheet for web-equivalent conditions',
|
|
|
assert.match(styles, /min-height:\s*44px/)
|
|
|
})
|
|
|
|
|
|
+test('freight list uses inline dropdown filters like presign instead of filter sheet', () => {
|
|
|
+ const freight = source('./modules/freight.js')
|
|
|
+ const genericList = source('../views/market/MarketModuleList.vue')
|
|
|
+ const styles = source('../styles/market.css')
|
|
|
+
|
|
|
+ assert.match(freight, /inlineDropdownFilters/)
|
|
|
+ assert.match(freight, /全部运输方式/)
|
|
|
+ assert.match(freight, /全部样本来源/)
|
|
|
+ assert.doesNotMatch(freight, /createTimeRange/)
|
|
|
+ assert.match(genericList, /inlineDropdownFilters/)
|
|
|
+ assert.match(genericList, /market-list__filter-row/)
|
|
|
+ assert.match(genericList, /van-dropdown-menu/)
|
|
|
+ assert.match(genericList, /applyInlineFilters/)
|
|
|
+ assert.match(styles, /\.market-list__filter-row\s*\{/)
|
|
|
+ assert.match(styles, /\.market-list__filter-row\s+\.van-dropdown-menu__bar/)
|
|
|
+})
|
|
|
+
|
|
|
+test('payment list uses inline dropdown filters like presign instead of filter sheet', () => {
|
|
|
+ const payment = source('./modules/payment.js')
|
|
|
+ const filters = source('./list-filters.js')
|
|
|
+ const genericList = source('../views/market/MarketModuleList.vue')
|
|
|
+
|
|
|
+ assert.match(payment, /inlineDropdownFilters/)
|
|
|
+ assert.match(payment, /全部缴费方式/)
|
|
|
+ assert.match(payment, /全部缴费进度/)
|
|
|
+ assert.doesNotMatch(payment, /dueDateRange/)
|
|
|
+ assert.doesNotMatch(payment, /应缴费时间/)
|
|
|
+ assert.match(filters, /payment: Object\.freeze\(\{[\s\S]*?payMode: ''[\s\S]*?progressStatus: ''/)
|
|
|
+ assert.doesNotMatch(filters, /installmentDueDateStart/)
|
|
|
+ assert.match(genericList, /inlineDropdownFilters/)
|
|
|
+ assert.match(genericList, /market-list__filter-row/)
|
|
|
+})
|
|
|
+
|
|
|
+test('freight list and detail wire cascade delete with confirm', () => {
|
|
|
+ const freight = source('./modules/freight.js')
|
|
|
+ const list = source('../views/market/MarketModuleList.vue')
|
|
|
+ const detail = source('../views/market/MarketModuleDetail.vue')
|
|
|
+ const presenter = source('./list-presenter.js')
|
|
|
+ const api = source('../api/market.js')
|
|
|
+
|
|
|
+ assert.match(freight, /'delete'/)
|
|
|
+ assert.match(presenter, /\['edit', 'delete', 'link', 'unlink'\]/)
|
|
|
+ assert.match(list, /deleteFreight/)
|
|
|
+ assert.match(list, /删除运费单/)
|
|
|
+ assert.match(detail, /async function deleteFreight/)
|
|
|
+ assert.match(api, /module === 'freight'[\s\S]*action === 'delete'/)
|
|
|
+})
|
|
|
+
|
|
|
+test('freight list cards collapse sample blocks by default and allow expand', () => {
|
|
|
+ const card = source('./components/MarketListCard.vue')
|
|
|
+ const presenter = source('./list-presenter.js')
|
|
|
+ const styles = source('../styles/market.css')
|
|
|
+
|
|
|
+ assert.match(presenter, /sampleBlocks:\s*rows\.map\(freightSampleBlock\)/)
|
|
|
+ assert.match(card, /card\.sampleBlocks/)
|
|
|
+ assert.match(card, /samplesOpen/)
|
|
|
+ assert.match(card, /关联样本(/)
|
|
|
+ assert.match(card, /点击展开/)
|
|
|
+ assert.match(card, /点击收起/)
|
|
|
+ assert.match(styles, /\.market-list-card__samples\s*\{/)
|
|
|
+ assert.match(styles, /\.market-list-card__samples-toggle\s*\{[\s\S]*?min-height:\s*44px;/)
|
|
|
+})
|
|
|
+
|
|
|
+test('payment list cards collapse period blocks by default and allow independent expand', () => {
|
|
|
+ const card = source('./components/MarketListCard.vue')
|
|
|
+ const presenter = source('./list-presenter.js')
|
|
|
+ const styles = source('../styles/market.css')
|
|
|
+
|
|
|
+ assert.match(presenter, /periodBlocks:\s*periods\.map\(paymentPeriodBlock\)/)
|
|
|
+ assert.match(presenter, /footerFields:/)
|
|
|
+ assert.match(card, /card\.periodBlocks/)
|
|
|
+ assert.match(card, /card\.footerFields/)
|
|
|
+ assert.match(card, /periodOpenKeys/)
|
|
|
+ assert.match(card, /aria-expanded/)
|
|
|
+ assert.match(card, /应缴费金额/)
|
|
|
+ assert.match(card, /已缴费金额/)
|
|
|
+ assert.match(styles, /\.market-list-card__periods\s*\{/)
|
|
|
+ assert.match(styles, /\.market-list-card__period-toggle\s*\{[\s\S]*?min-height:\s*44px;/)
|
|
|
+})
|
|
|
+
|
|
|
test('dedicated presign list wires orderStatus dropdown without reset on mobile', () => {
|
|
|
const presignList = source('../views/market/presign/PresignOrderList.vue')
|
|
|
const styles = source('../styles/market.css')
|
|
|
@@ -140,15 +227,24 @@ test('dedicated presign list wires orderStatus dropdown without reset on mobile'
|
|
|
|
|
|
test('freight sample selector supports source filters, server paging and confirmations', () => {
|
|
|
const form = source('../views/market/MarketModuleForm.vue')
|
|
|
+ const freight = source('./modules/freight.js')
|
|
|
+ const formSection = source('./components/MarketFormSection.vue')
|
|
|
const styles = source('../styles/market.css')
|
|
|
assert.match(form, /v-model="sampleSource"/)
|
|
|
+ assert.match(form, /market-sample-toolbar__filter-row/)
|
|
|
+ assert.match(form, /shape="round"/)
|
|
|
assert.match(form, /sampleOptionsPage/)
|
|
|
assert.match(form, /sampleOptionsRequestPending/)
|
|
|
assert.match(form, /loadMoreSampleOptions/)
|
|
|
assert.match(form, /pageSize:\s*SAMPLE_OPTION_PAGE_SIZE/)
|
|
|
assert.doesNotMatch(form, /page:\s*1,\s*pageSize:\s*100/)
|
|
|
assert.match(form, /确认关联样本/)
|
|
|
- assert.match(form, /确认取消运费/)
|
|
|
+ assert.match(form, /确认取消样本关联/)
|
|
|
+ assert.match(freight, /fieldsLayout:\s*'grid-2'/)
|
|
|
+ assert.match(formSection, /market-form-fields--grid-2/)
|
|
|
+ assert.match(styles, /\.market-form-fields--grid-2\s*\{/)
|
|
|
+ assert.match(styles, /\.market-sample-toolbar__filter-row\s*\{/)
|
|
|
+ assert.match(styles, /\.market-sample-toolbar__filter-row\s+\.van-dropdown-menu__bar/)
|
|
|
assert.match(styles, /\.market-sample-option\s*\{[\s\S]*?min-height:\s*44px;/)
|
|
|
assert.match(styles, /\.market-sample-option\s*\{[\s\S]*?min-width:\s*0;/)
|
|
|
assert.match(styles, /\.market-sample-option \.van-checkbox__label\s*\{[\s\S]*?overflow-wrap:\s*anywhere;/)
|