use robson_plugin_implementation_workflow::workers::TaskListWorker;

#[test]
fn task_list_pattern_matches_slash_task_list() {
    let re = regex::Regex::new(TaskListWorker::PATTERN).unwrap();
    assert!(re.is_match("/task list"));
}

#[test]
fn task_list_pattern_matches_with_bot_mention() {
    let re = regex::Regex::new(TaskListWorker::PATTERN).unwrap();
    assert!(re.is_match("<@U12345> /task list"));
}

#[test]
fn task_list_pattern_does_not_match_run_task() {
    let re = regex::Regex::new(TaskListWorker::PATTERN).unwrap();
    assert!(!re.is_match("/run-task key=FOO-1"));
}

#[test]
fn task_list_pattern_matches_case_insensitive() {
    let re = regex::Regex::new(TaskListWorker::PATTERN).unwrap();
    assert!(re.is_match("/TASK LIST"));
}
