weso / rdfshape-client

Web client for RDFShape API with human-friendly validations and visualizations.
https://rdfshape.weso.es
MIT License
11 stars 5 forks source link

Add tests with mocks #4

Open labra opened 4 years ago

labra commented 4 years ago

I have created a small test for the DataInfo component at: src/data/tests/dataInfo.test.js.

There are several things that I would like to improve:

1.- The test didn't work because it seems the method document.body.createTextRange is not implemented in jsDom. We found some questions in stack overflow that explain some solutions like this one. We added directly the code and it seems to work...however, it would be better to reuse that code in other components that depend on codeMirror. 2.- I would like to mock the axios calls to the server like it is explained in several places like here. 3.- I would like to test the rest of the components and options.