Skip to content

Commit

Permalink
adjust AccordionSectionControllerTest to initialize TestLifecycleOwne…
Browse files Browse the repository at this point in the history
…r after the main dispatcher is set
  • Loading branch information
frett committed Dec 20, 2024
1 parent 2e33259 commit 67e2255
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,19 @@ class AccordionSectionControllerTest {
@get:Rule
val instantTaskExecutorRule = InstantTaskExecutorRule()

private val baseLifecycleOwner = TestLifecycleOwner()
private val eventBus = mockk<EventBus>(relaxUnitFun = true)
private val accordionController = AccordionController(
mockkToolContentAccordionBinding(),
mockk {
every { eventBus } returns this@AccordionSectionControllerTest.eventBus
every { lifecycleOwner } returns baseLifecycleOwner
every { toolState } returns State()
},
mockk()
)
private val baseLifecycleOwner by lazy { TestLifecycleOwner() }
private val eventBus: EventBus = mockk(relaxUnitFun = true)
private val accordionController by lazy {
AccordionController(
mockkToolContentAccordionBinding(),
mockk {
every { eventBus } returns this@AccordionSectionControllerTest.eventBus
every { lifecycleOwner } returns baseLifecycleOwner
every { toolState } returns State()
},
mockk()
)
}

private lateinit var controller: AccordionController.SectionController

Expand Down

0 comments on commit 67e2255

Please sign in to comment.