patternfly / patternfly/patternfly-react

Improve tests for MultipleFileUpload

Đang mở
#11,854 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

PF Team Stale
Ngôn ngữ chính
TypeScript
Star
862
Fork
392
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
9

Mô tả

Describe the enhancement or change
Consumer reported the following:

Not really an issue, but I am puzzled by the slight behaviour change of the MultipleFileUpload component.
The onFileDrop callback sends an array of File objects, with properties like path. But it seems this propetrty
changed a little bit:
In PF5 I was getting for example: path: "image.png"
In PF6 I am getting: path: "./image.png"
That's not much of a change and is almost the same in a filesystem. But as I was using this info for the path of the object I am sending into Object Storage, it messed up my app a little bit.
Again, not an issue, I will handle it in my code, but I was wondering if there was a specific reason for this behaviour change? Which does not happen for single file upload btw, it's the plain name of the file only.

We use a third-party library for this piece of the component - we did bump from 14.2.3 to 14.3.5 between versions, so it's possible they changed the file name handling between versions. I don't see a big difference in our code. I do see that we have mostly snapshot tests for this component and do not test the third-party library functionality at all in our tests, so we wouldn't have caught this when we bumped the dependency. We could stand to improve our tests for this component in my opinion.

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?
No - not blocking.


Jira Issue: PF-1855

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với component MultipleFileUpload và các bài kiểm tra snapshot hiện có. Xem xét cách hành vi onFileDrop của thư viện bên thứ ba hiện được thể hiện, sau đó thêm coverage tập trung cho đường dẫn File được trả về và sự khác biệt với việc tải lên một tệp. Hoàn tất khi hành vi liên quan được kiểm thử thay vì chỉ được snapshot bao phủ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
frontend, testing
Loại issue
Tái cấu trúc
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.