package de.trainingstagebuch.app.utils

import de.trainingstagebuch.app.network.SocketEventType
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test

class SocketMessageUtilsTest {

    @Test
    fun `parseSocketIoEvent parses known wire event`() {
        val event = SocketMessageUtils.parseSocketIoEvent(
            "42[\"diary:note:added\",{\"id\":\"123\"}]"
        )

        assertNotNull(event)
        assertEquals(SocketEventType.DiaryNoteAdded, event?.type)
    }
}
