Skip to content

tests: add integration tests for media endpoints (DB layer) in api/src/media.rs #85

@MrSheerluck

Description

@MrSheerluck

Goal

Add integration tests for media handlers that interact with the database. These tests use in-memory SQLite with AppState { client: None, bucket: None } and do NOT require R2 storage.

File to edit

api/src/media.rs

Setup helper

use crate::AppState;

async fn setup_media_db() -> AppState {
    let db = sqlx::SqlitePool::connect("sqlite::memory:").await.unwrap();
    sqlx::migrate!("../migrations").run(&db).await.unwrap();
    AppState { db, client: None, bucket: None }
}

How to run

cd api && cargo test media

Sub-issues (pick one)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions