Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
use crate::EntityType;
use std::str::FromStr;
#[test]
fn it_should_build_entity_from_type() {
let entity = EntityType::Document.with_entity_str("my_entity_id");
assert_eq!(entity.entity_id, "my_entity_id");
assert_eq!(entity.entity_type, EntityType::Document);
}
#[test]
fn scheduled_action_round_trips_as_snake_case() {
let encoded = serde_json::to_string(&EntityType::ScheduledAction).unwrap();
assert_eq!(encoded, "\"scheduled_action\"");
assert_eq!(
serde_json::from_str::<EntityType>(&encoded).unwrap(),
EntityType::ScheduledAction
);
assert_eq!(EntityType::ScheduledAction.as_ref(), "scheduled_action");
assert_eq!(
EntityType::from_str("scheduled_action").unwrap(),
EntityType::ScheduledAction
);
}
#[test]
fn scheduled_action_is_not_an_entity_access_entity() {
assert!(!EntityType::ScheduledAction.is_valid_entity_access_entity());
}
#[test]
fn initiative_round_trips_as_snake_case() {
let encoded = serde_json::to_string(&EntityType::Initiative).unwrap();
assert_eq!(encoded, "\"initiative\"");
assert_eq!(
serde_json::from_str::<EntityType>(&encoded).unwrap(),
EntityType::Initiative
);
assert_eq!(EntityType::Initiative.as_ref(), "initiative");
assert_eq!(
EntityType::from_str("initiative").unwrap(),
EntityType::Initiative
);
}
#[test]
fn initiative_is_not_an_entity_access_entity() {
assert!(!EntityType::Initiative.is_valid_entity_access_entity());
}
#[test]
fn database_row_round_trips_as_snake_case() {
let encoded = serde_json::to_string(&EntityType::DatabaseRow).unwrap();
assert_eq!(encoded, "\"database_row\"");
assert_eq!(
serde_json::from_str::<EntityType>(&encoded).unwrap(),
EntityType::DatabaseRow
);
assert_eq!(EntityType::DatabaseRow.as_ref(), "database_row");
assert_eq!(
EntityType::from_str("database_row").unwrap(),
EntityType::DatabaseRow
);
}
#[test]
fn database_row_is_not_an_entity_access_entity() {
assert!(!EntityType::DatabaseRow.is_valid_entity_access_entity());
}
#[test]
fn form_round_trips_as_snake_case() {
let encoded = serde_json::to_string(&EntityType::Form).unwrap();
assert_eq!(encoded, "\"form\"");
assert_eq!(
serde_json::from_str::<EntityType>(&encoded).unwrap(),
EntityType::Form
);
assert_eq!(EntityType::Form.as_ref(), "form");
assert_eq!(EntityType::from_str("form").unwrap(), EntityType::Form);
}