Arquisoft / radarin_en3a

2 stars 1 forks source link

Problem implementing unitary tests #108

Closed uo270411 closed 3 years ago

uo270411 commented 3 years ago

Good afternoon @pglez82. We are having a problem with some components related to unitary tests. The error is on the test branch, and we are getting it with both mapView test and marker test. As you can see, test passes but the test suite is failing. The error is the following: ErrorMapView ErrorTests

pglez82 commented 3 years ago

In which branch this tests are failing?

uo270411 commented 3 years ago

These tests are implemented in test branch.

pglez82 commented 3 years ago

It checked the test in Marker.test.js. The thing is that usually, in unitary tests, is not as easy as rendering the component. You need to understand the component and check the implementation to see what the component need to be rendered. If you check the implementation of the MarkerGenerator component, it is calling the pod, and reading some properties so it renders properly. What you need to do is to mock up this parts so it doesn't need the pod information to render. More information here:

https://jestjs.io/docs/mock-functions

uo270411 commented 3 years ago

Ok, i Will check It, thank you!!