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

Expose didReceive(message:) and other component's functions #17

Merged
merged 4 commits into from
Aug 23, 2023

Conversation

svara
Copy link
Collaborator

@svara svara commented Aug 22, 2023

The goal of this PR is to make it easy to write tests for a component.
To achieve this, this PR:

  • Adds reply(with:) function to BridgeDelegate to avoid accessing the bridge directly from within the BridgeComponent.
  • Defines a public BridgingDelegate protocol to enable component testing by mocking the component's delegate.
  • Exposes, by making didReceive(message:) and all of component's view lifecycle functions public.

Additionally, in the ComponentTestExample folder, there's also a real word example of a component and its tests.

@svara svara changed the title Bridging delegate - WIP Expose didReceive(message:) and other components' functions Aug 22, 2023
@svara svara changed the title Expose didReceive(message:) and other components' functions Expose didReceive(message:) and other component's functions Aug 22, 2023
@svara svara requested a review from jayohms August 22, 2023 14:58
Copy link
Collaborator

@jayohms jayohms left a comment

Choose a reason for hiding this comment

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

Looks great and thank you for adding the example app component tests!

@svara svara merged commit 84d6b06 into main Aug 23, 2023
1 check passed
@svara svara deleted the bridging-delegate branch August 23, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants