Skip to content

Conversation

@shai-almog
Copy link
Collaborator

This commit adds 15 new test classes covering various UI features and edge cases:

  • SafeAreaTest: Tests for safe area insets and snap-to-safe-area functionality including portrait/landscape modes, toolbars, dialogs, and layered layouts

  • ScrollingTest: Tests for scrolling on x/y axes, nested containers, smooth scrolling, scroll listeners, and edge cases with empty/zero content

  • ZOrderingTest: Tests for z-ordering and component layering including LayeredLayout, glass panes, component reordering, and stacking behavior

  • AnimationEdgeCasesTest: Tests for animation edge cases including adding/ removing/replacing components during animation, morph animations, and animation interruption

  • FocusReplacementTest: Tests for replacing focused components with focusable or non-focusable components, handling disabled/invisible components

  • OrientationAndSizeTest: Tests for device orientation changes (portrait/ landscape) and size changes including layout reflow and safe area updates

  • RTLTest: Tests for RTL (Right-to-Left) functionality including toggling RTL, RTL with different layouts, text fields, toolbars, and nested containers

  • LocalizationTest: Tests for localization with resource bundles including multiple languages, fallback to defaults, RTL localization, and caching

  • DynamicLayoutTest: Tests for changing layouts dynamically and adapting to layout constraints including BorderLayout, BoxLayout, FlowLayout, GridLayout

  • KeyEventsTest: Tests for key events and game key events including arrow keys, game keys (up/down/left/right/fire), scrolling with game keys, and key event propagation

  • LeadComponentTest: Tests for lead component behavior using MultiButton to test checkboxes, radio buttons, custom lead components, and interaction

  • SurfaceModeTest: Tests for surface mode and elevated shadows including different elevation levels, rounded corners, background colors, and transparency

  • ScrollComponentToVisibleTest: Tests for scrollComponentToVisible edge cases including very large components, VKB hiding, nested containers, horizontal scrolling, and components with margins

  • ContainerMethodsTest: Tests for Container methods including getResponderAt, findDropTargetAt, updateTabIndices, drop, and getChildrenAsList with various configurations

  • LayoutAnimationTest: Tests for layout and hierarchy animation including unlayout animation, opacity/fade effects, morph animations, and animation with nested containers

All tests follow the existing test conventions:

  • Use @formtest or @EDTTest annotations
  • Extend UITestBase
  • Fire events through TestCodenameOneImplementation
  • Limited to Java 8 syntax
  • No reflection or binary resources
  • No changes outside maven/core-unittests

This commit adds 15 new test classes covering various UI features and edge cases:

- SafeAreaTest: Tests for safe area insets and snap-to-safe-area functionality
  including portrait/landscape modes, toolbars, dialogs, and layered layouts

- ScrollingTest: Tests for scrolling on x/y axes, nested containers, smooth
  scrolling, scroll listeners, and edge cases with empty/zero content

- ZOrderingTest: Tests for z-ordering and component layering including
  LayeredLayout, glass panes, component reordering, and stacking behavior

- AnimationEdgeCasesTest: Tests for animation edge cases including adding/
  removing/replacing components during animation, morph animations, and
  animation interruption

- FocusReplacementTest: Tests for replacing focused components with focusable
  or non-focusable components, handling disabled/invisible components

- OrientationAndSizeTest: Tests for device orientation changes (portrait/
  landscape) and size changes including layout reflow and safe area updates

- RTLTest: Tests for RTL (Right-to-Left) functionality including toggling RTL,
  RTL with different layouts, text fields, toolbars, and nested containers

- LocalizationTest: Tests for localization with resource bundles including
  multiple languages, fallback to defaults, RTL localization, and caching

- DynamicLayoutTest: Tests for changing layouts dynamically and adapting to
  layout constraints including BorderLayout, BoxLayout, FlowLayout, GridLayout

- KeyEventsTest: Tests for key events and game key events including arrow
  keys, game keys (up/down/left/right/fire), scrolling with game keys, and
  key event propagation

- LeadComponentTest: Tests for lead component behavior using MultiButton to
  test checkboxes, radio buttons, custom lead components, and interaction

- SurfaceModeTest: Tests for surface mode and elevated shadows including
  different elevation levels, rounded corners, background colors, and
  transparency

- ScrollComponentToVisibleTest: Tests for scrollComponentToVisible edge cases
  including very large components, VKB hiding, nested containers, horizontal
  scrolling, and components with margins

- ContainerMethodsTest: Tests for Container methods including getResponderAt,
  findDropTargetAt, updateTabIndices, drop, and getChildrenAsList with
  various configurations

- LayoutAnimationTest: Tests for layout and hierarchy animation including
  unlayout animation, opacity/fade effects, morph animations, and animation
  with nested containers

All tests follow the existing test conventions:
- Use @formtest or @EDTTest annotations
- Extend UITestBase
- Fire events through TestCodenameOneImplementation
- Limited to Java 8 syntax
- No reflection or binary resources
- No changes outside maven/core-unittests
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 30 to 33
btn.addKeyListener((keyEvent, code) -> {
keyPressed[0] = true;
keyCode[0] = code;
});

Choose a reason for hiding this comment

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

P0 Badge Replace component key listeners with form-level API

The new key event tests call btn.addKeyListener(...) and btn.addGameKeyListener(...) on Button and other components, but these methods exist only on Form (see Form.addKeyListener/addGameKeyListener). Neither Button nor Container defines these APIs, so the file doesn’t compile. The listeners should be added to the form or replaced with the appropriate component APIs before the test suite can build.

Useful? React with 👍 / 👎.

claude and others added 4 commits November 11, 2025 02:37
- KeyEventsTest: Remove non-existent addKeyListener/addGameKeyListener methods,
  use method overriding instead to test key events
- LocalizationTest: Remove non-existent getLocalizedString/isRTL methods,
  simplify to test actual L10NManager API (getLanguage, getCountry, format, etc.)
- ZOrderingTest: Changed glass pane to use Painter interface with lambda expression instead of Container
- SafeAreaTest: Removed entirely as the safe area API doesn't exist in the framework
- LocalizationTest: Removed tests using non-existent getCountry() method and avoided protected constructor
- SurfaceModeTest: Changed setElevation() calls from float to int parameters
- AnimationEdgeCasesTest: Fixed animateUnlayoutAndWait() to use correct signature (duration, opacity) after removeComponent()
- ContainerMethodsTest: Added required offset parameter to updateTabIndices() calls
- Add anonymous class braces to all L10NManager instantiations to work with protected constructor
- Remove all getCountry() method calls which don't exist in the API
@github-actions
Copy link

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants