Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Add four tests and fix code to make tests pass. #55747

Closed
wants to merge 4 commits into from

Conversation

iteriani
Copy link
Contributor

The first test asserts that bubbling does not work right now.

The second asserts that stopPropagation works, which should pass when test #1 passes too.

The third test asserts properties about the events passed to the event handler.

THe fourth test asserts that mouse events do not translate to jsaction nor help emit the jsaction binary. This required a change in code to make this pass.

The change looks like a lot because the indentation was fixed, but look at "bubbling behavior" and "should not replay mouse events"

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The first test asserts that bubbling does not work right now.

The second asserts that stopPropagation works, which should pass when test #1 passes too.

The third test asserts properties about the events passed to the event handler.

THe fourth test asserts that mouse events do not translate to jsaction nor help emit the jsaction binary. This required a change in code to make this pass.
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
packages/platform-server/test/event_replay_spec.ts Outdated Show resolved Hide resolved
This reuses information already recorded during hydration to
remove jsaction attributes to also stash event handlers. This avoids
a tree walk and looku.
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: rc This PR is targeted for the next release-candidate core: event dispatch labels May 10, 2024
@ngbot ngbot bot modified the milestone: Backlog May 10, 2024
@AndrewKushnir AndrewKushnir removed their request for review May 10, 2024 23:53
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

reviewed-for: fw-core, fw-platform-server

bottomEl.click();
expect(onClickSpy).toHaveBeenCalledTimes(2);
});
it('should not propagate events if stopPropagation is called', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

➕ 1

@iteriani iteriani added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 13, 2024
@atscott
Copy link
Contributor

atscott commented May 14, 2024

This PR was merged into the repository by commit 3ad120d.

atscott pushed a commit that referenced this pull request May 14, 2024
The first test asserts that bubbling does not work right now.

The second asserts that stopPropagation works, which should pass when test #1 passes too.

The third test asserts properties about the events passed to the event handler.

THe fourth test asserts that mouse events do not translate to jsaction nor help emit the jsaction binary. This required a change in code to make this pass.

PR Close #55747
atscott pushed a commit that referenced this pull request May 14, 2024
This reuses information already recorded during hydration to
remove jsaction attributes to also stash event handlers. This avoids
a tree walk and looku.

PR Close #55747
@atscott atscott closed this in 629b255 May 14, 2024
atscott pushed a commit that referenced this pull request May 14, 2024
This reuses information already recorded during hydration to
remove jsaction attributes to also stash event handlers. This avoids
a tree walk and looku.

PR Close #55747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime core: event dispatch target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants