integreat-cms
integreat-cms copied to clipboard
Add tests for HIX signals
Short description
This PR for HIX score representation on page edit
Proposed changes
Tests for:
- HIX score is requested and saved when the page translation is updated
- HIX score is not updated when hix is disabled on region level
- HIX score is not updated when hix is enabled on page level but hix_ignore flag is set to "on"
- HIX score is not updated when hix is enabled on page level and page content is empty
- HIX score is not updated when hix is enabled on page level and page content is not updated
- HIX score is requested but response 400 received. Hix score is not updated
Related issues
Relates to: #2582
One of new tests is failing. I think it would be better to fix it on CMS side. When TextLab API returns response with not a successful HTTP code (e.g. 400 like in test), it should ignore any value in the response body, even a valid one, like {"formulaHix": 15.48920568}
Could someone experienced please help with this? I am not sure how I can fix it in code...
Code Climate has analyzed commit 20f4c2c5 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 82.1% (0.2% change).
View more on Code Climate.
Giving this high priority as per request from the tech meeting (any issues regarding HIX). Not sure this changes much here and it is only about testing the existing functionality anyway, so don't feel pressured to reschedule your work-life-balance just to get this out a day or two earlier.
Thank you @seluianova for your comments and suggestions! Ready for final review round now
@MariaKabanova the new mock_server fixture has been merged https://github.com/digitalfabrik/integreat-cms/pull/2748, could you please update your tests to use it?
@seluianova thank you for your suggestions! I updated my code respectively