Skip to content

Query input/output non-functional #314

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

Closed
ddehart opened this issue Dec 6, 2020 · 6 comments · Fixed by #318
Closed

Query input/output non-functional #314

ddehart opened this issue Dec 6, 2020 · 6 comments · Fixed by #318
Labels
bug Something isn't working

Comments

@ddehart
Copy link
Contributor

ddehart commented Dec 6, 2020

Bug Report 🐛

To Reproduce ✔️

  1. Visit https://testing-playground.com/
  2. Change the getByRole query to any selector other than 'button'

testing-playground

Expected behavior 🤔

I expect QueryOutput to change based on my query

Your Environment 💻

  • browser: Chrome
  • os: Linux
@ddehart ddehart added the bug Something isn't working label Dec 6, 2020
@marcosvega91
Copy link
Member

Hi @ddehart thanks for raising this :).

I can confirm the bug. Do you wanna work on a fix? With e2e now we can create a test case for the issue and then fix.
Thanks a lot :)

@smeijer
Copy link
Member

smeijer commented Dec 7, 2020

For reference, it's 351c6ff that broke this (PR #296)

@delca85
Copy link
Member

delca85 commented Dec 7, 2020

For reference, it's 351c6ff that broke this (PR #296)

Yes, I confirm that. In PlaygroundPanels the query value is update while the result value not. I assume that the reason behind that is no listener function is dispatched on a new query insertion (

const listener = ({ data: { source, type, result } }) => {
).

@delca85
Copy link
Member

delca85 commented Dec 7, 2020

In my opinion, the error is somehow related to the usage of Suspense in PlaygroundPanels, removing that component the result is updated when a new query is inserted.

<Suspense fallback={null}>

Sorry for not having noticed that during the review.

@smeijer
Copy link
Member

smeijer commented Dec 7, 2020

That's a great finding @delca85. Thanks! Can you submit a PR? Just remove the suspense logic.

@delca85
Copy link
Member

delca85 commented Dec 7, 2020

I was wrong, this bug was not due by Suspense. I fixed it passing state and dispatch as props to PlaygroundPanels instead of making it retrieve them through usePlayground hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants