integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Add tests for HIX signals

Open MariaKabanova opened this issue 1 year ago • 2 comments

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


Pull Request Review Guidelines

MariaKabanova avatar Feb 21 '24 21:02 MariaKabanova

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...

MariaKabanova avatar Feb 22 '24 22:02 MariaKabanova

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.

codeclimate[bot] avatar Apr 03 '24 19:04 codeclimate[bot]

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.

PeterNerlich avatar Apr 16 '24 12:04 PeterNerlich

Thank you @seluianova for your comments and suggestions! Ready for final review round now

MariaKabanova avatar Apr 18 '24 05:04 MariaKabanova

@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 avatar Apr 21 '24 15:04 seluianova

@seluianova thank you for your suggestions! I updated my code respectively

MariaKabanova avatar Apr 21 '24 18:04 MariaKabanova