Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.0 KB
Raw Blame
use super::team_refresh_recipients;

fn found(users: &[&str]) -> Vec<Option<String>> {
    users.iter().map(|user| Some((*user).to_string())).collect()
}

#[test]
fn an_inbox_refresh_leaves_its_viewers_to_their_own_refresh() {
    let shared_by = [
        "macro|[email protected]".to_string(),
        "macro|[email protected]".to_string(),
    ];

    let recipients = team_refresh_recipients(
        found(&[
            "macro|[email protected]",
            "macro|[email protected]",
            "macro|[email protected]",
        ]),
        &shared_by,
        false,
    );

    assert_eq!(recipients, ["macro|[email protected]"]);
}

#[test]
fn a_sharing_change_also_refreshes_the_sharer() {
    let shared_by = ["macro|[email protected]".to_string()];

    let recipients = team_refresh_recipients(
        found(&["macro|[email protected]", "macro|[email protected]"]),
        &shared_by,
        true,
    );

    assert_eq!(
        recipients,
        ["macro|[email protected]", "macro|[email protected]"]
    );
}