Created
July 18, 2023 22:37
-
-
Save KwabenBerko/a9576174859ba23394c0a7f96e12075e to your computer and use it in GitHub Desktop.
Job Status Component Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OptIn(ExperimentalCoroutinesApi::class) | |
class JobStatusComponentTest { | |
@Test | |
fun `should call refresh function only once`() = runTest { | |
val jobs = mutableListOf<Job>() | |
val component = JobStatusComponent(scope = this) | |
repeat(10){ | |
jobs += launch { component.refresh() } | |
} | |
jobs.joinAll() | |
assertEquals(1, component.refreshesCount) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment