hm. Looks like using Awaitility library <https://g...
# tornadofx
a
hm. Looks like using Awaitility library https://github.com/awaitility/awaitility something like this works
Copy code
val vm = TokensViewModel()

    init {
        FxToolkit.registerPrimaryStage()
    }

    @Test
    fun loadsTokens() {
        vm.loadTokens()

        await().atMost(10000, MILLISECONDS).until { !vm.status.running.value }

        assertNotEquals(0, vm.tokens.size)
    }
but I am not completely sure why and how it works. And looks like it is polling
status
not from UI thread