From 0bb17bd01640492db2685e67bacac12dd54a9f59 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 24 Oct 2024 22:37:22 -0400 Subject: Tests for channel, invite, setup, and message deletion events. This also found a bug! No live event was being emitted during invite accept. The only way to find out about invites was to reconnect. --- src/test/fixtures/login.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/test/fixtures/login.rs') diff --git a/src/test/fixtures/login.rs b/src/test/fixtures/login.rs index e308289..cbcbdd4 100644 --- a/src/test/fixtures/login.rs +++ b/src/test/fixtures/login.rs @@ -1,9 +1,12 @@ +use std::future::{self, Ready}; + use faker_rand::en_us::internet; use uuid::Uuid; use crate::{ app::App, clock::RequestedAt, + event::Event, login::{self, Login, Password}, name::Name, }; @@ -45,3 +48,16 @@ fn propose_name() -> Name { pub fn propose_password() -> Password { Uuid::new_v4().to_string().into() } + +pub fn events(event: Event) -> Ready> { + future::ready(match event { + Event::Login(event) => Some(event), + _ => None, + }) +} + +pub fn created(event: login::Event) -> Ready> { + future::ready(match event { + login::Event::Created(event) => Some(event), + }) +} -- cgit v1.2.3