Skip to content

Add auto capitalization unit tests#4168

Merged
shai-almog merged 10 commits intomasterfrom
codex/port-autocapitalizationtest-to-unit-tests
Nov 26, 2025
Merged

Add auto capitalization unit tests#4168
shai-almog merged 10 commits intomasterfrom
codex/port-autocapitalizationtest-to-unit-tests

Conversation

@shai-almog
Copy link
Collaborator

Summary

  • add UI unit tests ported from the AutoCapitalization sample using UITestBase and FormTest
  • simulate auto-capitalization behavior inside TestCodenameOneImplementation to drive keypress-based tests

Testing

  • mvn -f maven/pom.xml -Punittests -pl core-unittests -Dtest=AutoCapitalizationSampleTest test (fails: missing com.codenameone:codenameone-factory:8.0-SNAPSHOT dependency in local environment)

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1112 to +1115
char adjustedCharacter = applyAutoCapitalization(area, character, current, cursor);
StringBuilder sb = new StringBuilder(current.length() + 1);
sb.append(current, 0, cursor);
sb.append(character);
sb.append(adjustedCharacter);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Auto-capitalization not triggered for TextField key presses

The new auto-capitalization helper is only invoked inside insertCharacter, which is reached from the editString TextArea branch. The editString TextField branch still routes key presses through TextField.insertChars without ever calling this helper, so dispatching key presses while editing a TextField leaves the text lowercase. The newly added AutoCapitalizationSampleTest constructs a TextField and expects initial-caps behavior on sentences and words, so both tests will fail because the capitalization logic never runs for that code path.

Useful? React with 👍 / 👎.

@github-actions
Copy link

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog shai-almog merged commit ae6330d into master Nov 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant