compose-multiplatform-core icon indicating copy to clipboard operation
compose-multiplatform-core copied to clipboard

Implement LifecycleOwner in tests

Open kropp opened this issue 10 months ago • 4 comments

Proposed Changes

  • Implement LifecycleOwner in tests, provide it in LocalLifecycleOwner
  • Provide the means to change Lifecycle in runComposeUiTest

Testing

Test: LifecycleInTestsTest

kropp avatar Apr 19 '24 14:04 kropp

Does Android provide LifecycleOwner in tests?

m-sasha avatar Apr 19 '24 15:04 m-sasha

Does Android provide LifecycleOwner in tests?

I don't think so.

Delegating the review to m-sasha, as the owner of ui-test

igordmn avatar Apr 19 '24 15:04 igordmn

@m-sasha LocalLifecycleOwner should be available, yes. For sending events: rule.scenario.moveToState(RESUMED)

MatkovIvan avatar Apr 19 '24 16:04 MatkovIvan

If Android's ui-test doesn't include lifecycle stuff, I'm thinking maybe we shouldn't either. Can we provide the same functionality from e.g. lifecycle-test?

m-sasha avatar Apr 19 '24 16:04 m-sasha