code-corps / code-corps/ember-stripe-elements
Error in testing when updating arguments passed to stripe components
- Ngôn ngữ chính
- JavaScript
- Star
- 64
- Fork
- 39
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Even though we have turned the `mock` config option on during testing, we still get an error about a missing method, `update`, when running our test suite:
> Uncaught TypeError: `Ember.get(...).update` is not a function
It's pointing to here:
https://github.com/code-corps/ember-stripe-elements/blob/74540fc5ed106b86916eef2c29059e231095903d/addon/components/stripe-element.js#L54-L57
I'm guessing this is just because that method isn't mocked in your `StripeMock` class and that's merely because you don't have any tests that try to update the attributes after rendering. Replacing your mock with our own copy which also mocks the `update` function makes our tests pass again.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với addon/components/stripe-element.js ở các dòng 54-57, sau đó kiểm tra lớp StripeMock và chạy bộ kiểm thử để tái hiện phương thức update còn thiếu. Bổ sung coverage cho việc cập nhật các đối số của component sau khi render, và xem issue là hoàn tất khi mock hỗ trợ lời gọi đó và các kiểm thử đều pass mà không có TypeError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100