Skip to content

Added a unit test for checking cloze counter numbering while toggling.#20408

Open
Alok-Silswal wants to merge 1 commit intoankidroid:mainfrom
Alok-Silswal:test-toggle-cloze-counter
Open

Added a unit test for checking cloze counter numbering while toggling.#20408
Alok-Silswal wants to merge 1 commit intoankidroid:mainfrom
Alok-Silswal:test-toggle-cloze-counter

Conversation

@Alok-Silswal
Copy link

Purpose / Description

While solving #20350 issue and working with #20398 PR, I noticed that there is no unit test that checks if the cloze counter number is correct while toggling mode (from INCREMENT to NO_INCREMENT and vice-versa).

It is the by-product of observations as mentioned in #20350 (comment)

As a result of the absence of this unit test, even an incorrect implementation(intermediate code I used while testing) is passing all the unit tests.

Fixes

Approach

It checks if the cloze counter number is assigned the correct value when we switch modes each time, by creating a unit test.

How Has This Been Tested?

This test fails on main but passes with fix made in #20398 PR.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@Alok-Silswal
Copy link
Author

Alok-Silswal commented Mar 6, 2026

@david-allison Submitting this as a separate PR to keep the original fix focused and instructions as given in #20398 (comment) i.e.

When you're bugfixing, keep the commit as lean as possible:

  • fix
  • test

If you notice more tests could be added, feel free to either add them as a new commit, or raise a separate PR. No issue necessary

This change only adds additional test coverage for toggle behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant