Skip to content

chore: exercise atoms against Angular-rendered DOM - #536

Merged
mykola-mokhnach merged 3 commits into
appium:masterfrom
mykola-mokhnach:angular
Aug 13, 2026
Merged

chore: exercise atoms against Angular-rendered DOM#536
mykola-mokhnach merged 3 commits into
appium:masterfrom
mykola-mokhnach:angular

Conversation

@mykola-mokhnach

Copy link
Copy Markdown
Contributor

Mirrors #535's React fixture with a zoneless standalone Angular component (text/checkbox/select/radio/OTP-autofocus/disabled/conditional-style/submit, plus @if/@for control-flow blocks that add/remove real DOM nodes). Mounting uses provideZonelessChangeDetection since zone.js's global patching fights Node's test runner; tests flush change detection explicitly via tick().

Exercising clear() against it surfaced a real gap: it only fired a 'change' event, never 'input', so frameworks that bind to 'input' for live updates (Angular, Vue, vanilla — React is the outlier, also treating 'change' as an input-changed signal) never saw a cleared field. Fixed to fire input events too, matching how a real user's select-all + delete behaves.

…atic fixtures

Mirrors appium#535's React fixture with a zoneless standalone Angular component
(text/checkbox/select/radio/OTP-autofocus/disabled/conditional-style/submit,
plus @if/@for control-flow blocks that add/remove real DOM nodes). Mounting
uses provideZonelessChangeDetection since zone.js's global patching fights
Node's test runner; tests flush change detection explicitly via tick().

Exercising clear() against it surfaced a real gap: it only fired a 'change'
event, never 'input', so frameworks that bind to 'input' for live updates
(Angular, Vue, vanilla — React is the outlier, also treating 'change' as an
input-changed signal) never saw a cleared field. Fixed to fire input events
too, matching how a real user's select-all + delete behaves.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Every it() in react.spec.ts/angular.spec.ts repeated the same mount +
patchLayout() + unmount-tracking boilerplate. Move it into beforeEach/
afterEach so each test only contains the interaction it's actually checking.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mykola-mokhnach mykola-mokhnach changed the title chore: exercise atoms against Angular-rendered DOM, not just React/static fixtures chore: exercise atoms against Angular-rendered DOM Aug 12, 2026
Comment thread atoms/src/core/action.ts Outdated
// then 'change' once the field loses focus. Frameworks bound to 'input' for live updates (most
// of them — React is unusual in also treating 'change' as an input-changed signal) never see
// the clear without it.
fire(element, EventType.TEXTINPUT);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we omit the textInput event here and keep only input?

Clearing via select-all + Delete is a deletion operation, while the UI Events algorithm only emits the obsolete textInput event for text insertion—not deletion. Dispatching it here could trigger legacy insertion handlers in addition to the correct input handler.

It would also be useful to add an event-sequence assertion covering this behavior.

Reference: https://w3c.github.io/uievents/event-algo.html#fire-key-input-events

--

I got comment the above by Codex. I'd like to double check if this is vald

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, and confirmed valid. This codebase already draws exactly that insertion-vs-deletion line elsewhere: updateOnBackspaceOrDelete() in atoms/src/core/keyboard.ts (the real backspace/delete handler) fires only INPUT, never TEXTINPUT, while updateOnKeyPress() (character insertion) fires both. Clearing is a deletion, so it should follow the same pattern as backspace/delete, not the insertion path. Will drop the TEXTINPUT line from clear() and add an event-sequence assertion.

clear() fired 'textInput' before 'input'/'change', but per the UI Events
spec that event is scoped to text insertion, not deletion — clearing is a
deletion. keyboard.ts's updateOnBackspaceOrDelete() already draws this same
line for real backspace/delete keystrokes (input only, no textInput); clear()
should follow it too, not the insertion path's event set.

Found via PR review: appium#536 (comment)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mykola-mokhnach
mykola-mokhnach merged commit 9399ac1 into appium:master Aug 13, 2026
10 checks passed
@mykola-mokhnach
mykola-mokhnach deleted the angular branch August 13, 2026 09:09
github-actions Bot pushed a commit that referenced this pull request Aug 13, 2026
## [17.0.7](v17.0.6...v17.0.7) (2026-08-13)

### Miscellaneous Chores

* exercise atoms against Angular-rendered DOM ([#536](#536)) ([9399ac1](9399ac1))
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 17.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants