Add test on MessagesViewTest: clicking on a custom emoji emits the expected Events.

And fix a bug, the Event `CustomReactionEvents.DismissCustomReactionSheet` is actually managed by the BottomSheet itself.
This commit is contained in:
Benoit Marty 2024-02-09 22:22:32 +01:00 committed by Benoit Marty
parent 64435db282
commit e8ad3c8f9c
3 changed files with 47 additions and 2 deletions

View file

@ -154,9 +154,10 @@ fun aReactionSummaryState(
)
fun aCustomReactionState(
target: CustomReactionState.Target = CustomReactionState.Target.None,
eventSink: (CustomReactionEvents) -> Unit = {},
) = CustomReactionState(
target = CustomReactionState.Target.None,
target = target,
selectedEmoji = persistentSetOf(),
eventSink = eventSink,
)

View file

@ -250,7 +250,6 @@ fun MessagesView(
state = state.customReactionState,
onEmojiSelected = { eventId, emoji ->
state.eventSink(MessagesEvents.ToggleReaction(emoji.unicode, eventId))
state.customReactionState.eventSink(CustomReactionEvents.DismissCustomReactionSheet)
}
)