test(sqlite): cover inviter preservation on reactivation

Signed-off-by: Brother Darryl <146fb160a3266e6165bfa385f6048c975eda9e21cf65da097a0b5ea7952532a5@buzz.block.builderlab.xyz>
This commit is contained in:
Brother Darryl
2026-08-10 16:23:33 -04:00
parent ed6e79460f
commit 67debfa7eb

View File

@@ -745,6 +745,26 @@ mod tests {
.await
.unwrap();
assert_eq!(readded.invited_by, Some(owner.to_vec()));
sqlx::query::<sqlx::Sqlite>(
"UPDATE channel_members SET removed_at = unixepoch() WHERE channel_id = ?1 AND pubkey = ?2",
)
.bind(channel_id.to_string())
.bind(&member[..])
.execute(&pool)
.await
.unwrap();
let reactivated = add_member(
&pool,
community.id,
channel_id,
&member,
crate::channel::MemberRole::Member,
Some(&admin),
)
.await
.unwrap();
assert_eq!(reactivated.invited_by, Some(owner.to_vec()));
assert!(reactivated.removed_at.is_none());
assert!(matches!(
add_member(
&pool,