chorus/tests/gateway.rs

25 lines
647 B
Rust
Raw Normal View History

2023-06-08 19:51:32 +02:00
mod common;
use chorus::gateway::*;
use chorus::types;
#[tokio::test]
/// Tests establishing a connection (hello and heartbeats) on the local gateway;
async fn test_gateway_establish() {
let bundle = common::setup().await;
Gateway::new(bundle.urls.wss).await.unwrap();
}
#[tokio::test]
/// Tests establishing a connection and authenticating
async fn test_gateway_authenticate() {
let bundle = common::setup().await;
let gateway = Gateway::new(bundle.urls.wss).await.unwrap();
let mut identify = types::GatewayIdentifyPayload::common();
identify.token = bundle.user.token;
gateway.send_identify(identify).await;
}