优化
This commit is contained in:
@@ -45,18 +45,16 @@ test('three fixed receiving photo roles and string file IDs are frozen', () => {
|
||||
assert.doesNotMatch(inbound, /customerId|planNo|allocationId|warehouseId|locationId/)
|
||||
})
|
||||
|
||||
test('camera or album replaces only one fixed slot and failed replacement preserves its previous success', () => {
|
||||
assert.match(page, /choosePhotos\(index, sourceType\)[\s\S]*uni\.chooseImage\(\{ count: 1, sourceType: \[sourceType\]/)
|
||||
assert.match(page, /choosePhotos\(index, 'camera'\)/)
|
||||
assert.match(page, /choosePhotos\(index, 'album'\)/)
|
||||
test('camera replaces only one fixed slot and failed retake preserves its previous success', () => {
|
||||
assert.match(page, /choosePhoto\(index\)[\s\S]*uni\.chooseImage\(\{ count: 1, sourceType: \['camera'\]/)
|
||||
assert.doesNotMatch(page, /sourceType:\s*\['album'\]|从相册选择|换照片/)
|
||||
assert.match(page, /async replacePhoto\(index, path\)[\s\S]*const previous = receiving\.photoSlots\[index\]/)
|
||||
assert.match(page, /await uploadCurrentUnloadPhoto\(path\)[\s\S]*fileId: String\(file\.fileId\)[\s\S]*localPath: path/)
|
||||
assert.match(page, /previous\?\.fileId \? \{ \.\.\.previous, status: 'error'/)
|
||||
assert.match(page, /status: 'uploading'/)
|
||||
assert.match(page, /status: 'error'/)
|
||||
assert.match(page, /已保留原图/)
|
||||
assert.match(page, /photoSlots\[index\]\?\.fileId \? '重拍' : '拍照'/)
|
||||
assert.match(page, /photoSlots\[index\]\?\.fileId \? '重新选择' : '从相册选择'/)
|
||||
assert.match(page, /photoStateLabel\(photo\)[\s\S]*operation\.retakeFailedKept[\s\S]*operation\.uploadFailed/)
|
||||
assert.match(page, /photoSlots\[index\]\?\.fileId \? \$t\('operation\.retake'\) : \$t\('operation\.takePhoto'\)/)
|
||||
assert.match(page, /previewPhoto\(index\)/)
|
||||
assert.match(page, /uploadedPhotoCount\(\) \{ return this\.photoSlots\.filter\(\(item\) => item\?\.fileId\)\.length \}/)
|
||||
assert.match(page, /photosReady\(\) \{ return this\.uploadedPhotoCount === 3 && !this\.photoSlots\.some/)
|
||||
@@ -64,6 +62,11 @@ test('camera or album replaces only one fixed slot and failed replacement preser
|
||||
assert.match(page, /async signContainer\(\) \{ if \(!this\.photosReady\) return;/)
|
||||
assert.match(page, /const photos = this\.photoSlots\.map\(/)
|
||||
assert.doesNotMatch(page, /count:\s*9|flatMap\(|photoSlots\[index\]\.push/)
|
||||
assert.match(page, /\.photo-grid\{display:grid;grid-template-columns:1fr/)
|
||||
assert.match(page, /grid-template-columns:82px minmax\(0,1fr\) 78px/)
|
||||
assert.match(page, /class="photo-role-info"/)
|
||||
assert.match(page, /onShow\(\)[\s\S]*this\.inboundMode && !this\.bootstrapped[\s\S]*this\.bootstrap\(\)/)
|
||||
assert.match(page, /await this\.applyCurrentReceiving\(current\); this\.bootstrapped = true/)
|
||||
})
|
||||
|
||||
test('local thumbnail, preview, and authenticated session restore are wired to the frozen contract', () => {
|
||||
@@ -71,3 +74,9 @@ test('local thumbnail, preview, and authenticated session restore are wired to t
|
||||
assert.deepEqual(photoUiBlockers().map((item) => item.code), [])
|
||||
assert.ok(photoUiBlockers().every((item) => item.deploymentBlocker === true && item.reason))
|
||||
})
|
||||
|
||||
test('fixed receiving action leaves enough scroll-safe space above the PDA bottom bar', () => {
|
||||
assert.match(page, /receiving-content\{[^}]*padding-bottom:calc\(152px \+ env\(safe-area-inset-bottom,0px\)\)/)
|
||||
assert.match(page, /primary-button,\.secondary-button,\.ghost-button\{[^}]*align-items:center;justify-content:center[^}]*line-height:normal;text-align:center/)
|
||||
assert.match(page, /sticky-action button\{[^}]*align-items:center;justify-content:center;line-height:normal;text-align:center/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user