Skip to content

Component instance unit tests#1689

Closed
kantuni wants to merge 9 commits intostreamlit:developfrom
kantuni:component-instance-test
Closed

Component instance unit tests#1689
kantuni wants to merge 9 commits intostreamlit:developfrom
kantuni:component-instance-test

Conversation

@kantuni
Copy link
Copy Markdown
Collaborator

@kantuni kantuni commented Jul 8, 2020

No description provided.

@kantuni kantuni requested a review from tconkling July 8, 2020 19:21
@kantuni kantuni requested a review from a team as a code owner July 8, 2020 19:21
@tconkling
Copy link
Copy Markdown
Contributor

@kantuni and I chatted about this offline, and agreed that the way forward is to not test the class's private methods directly, but instead to create a mock component to test the data flow between ComponentInstance and components themselves.

This should be testing that args are delivered from ComponentInstance to the component via the expected postMessage call, and that the various ComponentMessageType messages that are posted from component -> ComponentInstance are handled and do the right things.

tconkling added a commit that referenced this pull request Sep 2, 2020
Unit tests for `ComponentInstance.tsx`

These involve slightly complex plumbing, because they're testing the communication between `ComponentInstance` and its iframe, which all happens via `postMessage`.

This PR supersedes #1689 - that PR can be closed.
@tconkling
Copy link
Copy Markdown
Contributor

Superseded by #1956

@tconkling tconkling closed this Sep 2, 2020
@kantuni kantuni deleted the component-instance-test branch January 5, 2021 13:52
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