Open LotteHofstede opened 6 years ago
Currently some spec files that are dependent on services use the actual service in their tests. This leads to unit tests that can stop working unexpectedly. We should aim to write tests that mock everything but the part we're testing.
List of files I found missing mocked services: https://github.com/DSpace/dspace-angular/blob/master/src/app/core/metadata/metadata.service.spec.ts#L86 https://github.com/DSpace/dspace-angular/blob/master/src/app/shared/notifications/notifications.service.spec.ts#L42 https://github.com/DSpace/dspace-angular/blob/master/src/app/core/data/config-response-parsing.service.spec.ts#L18 https://github.com/DSpace/dspace-angular/blob/master/src/app/core/integration/integration-response-parsing.service.spec.ts#L17 https://github.com/DSpace/dspace-angular/blob/master/src/app/core/auth/auth-response-parsing.service.spec.ts#L17
Unclear whether this is still valid as it's nearly 2 years old
None of these seem to have been fixed yet. Although one service has been removed. I'd keep this ticket open.
Currently some spec files that are dependent on services use the actual service in their tests. This leads to unit tests that can stop working unexpectedly. We should aim to write tests that mock everything but the part we're testing.
List of files I found missing mocked services: https://github.com/DSpace/dspace-angular/blob/master/src/app/core/metadata/metadata.service.spec.ts#L86 https://github.com/DSpace/dspace-angular/blob/master/src/app/shared/notifications/notifications.service.spec.ts#L42
https://github.com/DSpace/dspace-angular/blob/master/src/app/core/data/config-response-parsing.service.spec.ts#L18https://github.com/DSpace/dspace-angular/blob/master/src/app/core/integration/integration-response-parsing.service.spec.ts#L17 https://github.com/DSpace/dspace-angular/blob/master/src/app/core/auth/auth-response-parsing.service.spec.ts#L17