Arquisoft / lomap_en3b

LoMap Software architecture group en3b course 2022_23
https://arquisoft.github.io/lomap_en3b
6 stars 0 forks source link

Unitary Tests #57

Closed FdezAriasSara closed 1 year ago

FdezAriasSara commented 1 year ago

-Unitary tests for rendering

FdezAriasSara commented 1 year ago

@Batuhanbyr @RaduSeba

Guys one thing. in order to be able to make tests i will be adding two things:

image

It prevents every other part ( header, and all info lists to appear) when loading the map goes wrong for some reason. That is absolutely fine, but it makes it impossible to test, since tests wont start a session and therefore no maps petition is done .

The new version will do the following:

I created a simple error view to be displayed instead of the map: image

that way , the header and submenus render and i can test them

FdezAriasSara commented 1 year ago

I just realized I made a mistake when modifying the sonarcloud configuration file, that would make the coverage be equal to 0%

FdezAriasSara commented 1 year ago

Good morning,@pglez82

I was not able to get sonarcloud to percieve any code coverage.

I tried it all:

im trying to test more in depth, like functions being called, but i cannot always do that since some of them( the majority ) are handlers and are just arrowfunctions not being exported...

im not quite sure if the problem is sonarcloud file, my tests being bad or the way our code is that allows no coverage somehow?

here's the link to the sonarcloud report just in case it might be usefull.. https://sonarcloud.io/component_measures?metric=new_coverage&selected=Arquisoft_lomap_en3b%3Awebapp%2Fsrc%2Fcomponents%2FHeader.js&view=list&id=Arquisoft_lomap_en3b

I don't know what else to do with it..

Thank you in advance

Sara

pglez82 commented 1 year ago

Can you add to package.json:

"test": "react-scripts test", the option --coverage?

Seems to me that it is not generating any coverage report.

FdezAriasSara commented 1 year ago

Can you add to package.json:

"test": "react-scripts test", the option --coverage?

Seems to me that it is not generating any coverage report.

Thank you so much.. image