Skip to content

Conversation

@anddrzejb
Copy link
Contributor

Pull request description

Fixes #522

Adds to SetVoidResult to FocusAsyncInvocationHandler & FocusOnNavigateHandler. Without it, if consumer was awaiting the result of the call to respective js, a Task with Status = WaitingForActivation was returned. This way the call was never finishing. Adding SetVoidResult markes the returned task as completed.

Tests

I figured the best way to find out if task was completed was to add a boolean after the call in question. If task was completed, the boolean is set to true. That boolean property is later asserted in the test. In both cases the tests do not pass without SetVoidResult.

Testing this in FocusOnNavigateHandler required me to create a derived component, so I can actually add the boolean property.

PR meta checklist

  • Pull request is targeted at main branch for code
    or targeted at stable branch for documentation that is live on bunit.dev.
  • Pull request is linked to all related issues, if any.
  • I have read the CONTRIBUTING.md document.

Code PR specific checklist

  • My code follows the code style of this project and AspNetCore coding guidelines.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have updated the appropriate sub section in the CHANGELOG.md.
  • I have added, updated or removed tests to according to my changes.
    • All tests passed.

egil
egil previously approved these changes Oct 20, 2021
Copy link
Member

@egil egil left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Just add a bullet point to the Unreleased/Fixed section in the CHANGELOG.md file about this.

@anddrzejb
Copy link
Contributor Author

Done. I can't figure out why ubuntu action was failing.

@anddrzejb anddrzejb changed the title add SetVoidResult to Focus hanlders with tests Add SetVoidResult to Focus hanlders with tests Oct 20, 2021
@anddrzejb anddrzejb changed the title Add SetVoidResult to Focus hanlders with tests Add SetVoidResult to Focus handlers with tests Oct 20, 2021
@egil
Copy link
Member

egil commented Oct 20, 2021

Done. I can't figure out why ubuntu action was failing.

Looks like a test host failure. I'll rerun and let's see if that doesn't help.

Co-authored-by: Egil Hansen <egil@assimilated.dk>
@egil egil enabled auto-merge (squash) October 20, 2021 12:24
@egil egil merged commit b8624d0 into bUnit-dev:main Oct 20, 2021
@anddrzejb anddrzejb deleted the focusSetResult branch October 20, 2021 12:32
@egil
Copy link
Member

egil commented Oct 20, 2021

Thank you very much for your help on this. Good catch with this bug!

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.

ElementReference.FocusAsync(true) does not seem to be registered

2 participants