code-corps / code-corps/ember-stripe-elements
Error in testing when updating arguments passed to stripe components
- 主要语言
- JavaScript
- 星标
- 64
- 派生
- 39
- PR 合并指标
- 30 天内没有已合并 PR
描述
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.
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 addon/components/stripe-element.js 的第54-57行开始,然后检查 StripeMock 类并运行测试套件,以复现缺失的 update 方法。为渲染后更新组件参数添加测试覆盖;当 mock 支持该调用且测试在没有 TypeError 的情况下通过时,即可认为该 issue 已完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100