code-corps / code-corps/ember-stripe-elements

Error in testing when updating arguments passed to stripe components

Abierto
#48 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
64
Forks
39
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start with addon/components/stripe-element.js at lines 54-57, then inspect the StripeMock class and run the test suite to reproduce the missing update method. Add coverage for updating component arguments after rendering, and consider the issue done when the mock supports that call and the tests pass without the TypeError.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
frontend
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.