优化
This commit is contained in:
@@ -47,13 +47,16 @@ test('three fixed receiving photo roles and string file IDs are frozen', () => {
|
||||
|
||||
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.match(page, /MAX_UNLOAD_PHOTO_BYTES = 10 \* 1024 \* 1024/)
|
||||
assert.match(page, /tempFiles\?\.\[0\]\?\.size[\s\S]*照片不能超过10MB/)
|
||||
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, /photoStateLabel\(photo\)[\s\S]*已保留原图[\s\S]*上传失败/)
|
||||
assert.match(page, /photoStateLabel\(photo\)[\s\S]*photo\.errorMessage/)
|
||||
assert.match(page, /this\.showToast\(error\.message \|\| '照片上传失败', 'error'\)/)
|
||||
assert.match(page, /photoSlots\[index\]\?\.fileId \? '重拍' : '拍照'/)
|
||||
assert.match(page, /previewPhoto\(index\)/)
|
||||
assert.match(page, /uploadedPhotoCount\(\) \{ return this\.photoSlots\.filter\(\(item\) => item\?\.fileId\)\.length \}/)
|
||||
|
||||
Reference in New Issue
Block a user