Files

22 lines
1.0 KiB
C++
Raw Permalink Normal View History

// Route: GET /ai/audio (page, no credential needed)
#include "support/Assert.hpp"
using namespace molo::example::test;
int main() {
Fixture f;
auto res = f.client->get("/ai/audio");
check(res.status == 200, "status 200");
check(contains(res.headers.get("Content-Type"), "text/html"), "html");
check(contains(res.body, "Audio") && contains(res.body, "viewport"), "page and mobile viewport");
check(contains(res.body, "/embedded/ai_audio.js"), "script wired");
check(contains(res.body, "<select id=\"au-route\""), "route picker is a dropdown, not a button group");
check(contains(res.body, "<select id=\"au-provider\""), "provider picker is a dropdown");
check(f.client->post("/ai/audio", "{}", "application/json").status == 405, "post is 405");
auto js = f.client->get("/embedded/ai_audio.js");
check(js.status == 200 && contains(js.body, "/ai/audio/"), "script is served");
auto idx = f.client->get("/");
check(idx.status == 200 && contains(idx.body, "/ai/audio"), "matrix lists the page");
return finish("ai/audio/page");
}