Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions src/integration_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,52 @@ test "integration harness covers orchestration proxy not configured" {
try std.testing.expectEqual(std.http.Status.service_unavailable, resp.status);
try std.testing.expect(std.mem.indexOf(u8, resp.body, "NullBoiler not configured") != null);
}

test "integration harness covers wizard failure contracts" {
var server = try IntegrationServer.start(std.testing.allocator);
defer server.deinit();

{
const resp = try server.fetch(.{
.path = "/api/wizard/nullclaw",
.method = .POST,
.body = "{",
});
defer resp.deinit(std.testing.allocator);
try std.testing.expectEqual(std.http.Status.bad_request, resp.status);
try std.testing.expect(std.mem.indexOf(u8, resp.body, "invalid JSON body") != null);
}

{
const resp = try server.fetch(.{
.path = "/api/wizard/missing-component",
.method = .POST,
.body = "{\"instance_name\":\"demo\"}",
});
defer resp.deinit(std.testing.allocator);
try std.testing.expectEqual(std.http.Status.not_found, resp.status);
try std.testing.expect(std.mem.indexOf(u8, resp.body, "component not found") != null);
}

{
const resp = try server.fetch(.{
.path = "/api/wizard/nullclaw/validate-providers",
.method = .POST,
.body = "{",
});
defer resp.deinit(std.testing.allocator);
try std.testing.expectEqual(std.http.Status.bad_request, resp.status);
try std.testing.expect(std.mem.indexOf(u8, resp.body, "invalid JSON body") != null);
}

{
const resp = try server.fetch(.{
.path = "/api/wizard/missing-component/validate-providers",
.method = .POST,
.body = "{\"providers\":[]}",
});
defer resp.deinit(std.testing.allocator);
try std.testing.expectEqual(std.http.Status.not_found, resp.status);
try std.testing.expect(std.mem.indexOf(u8, resp.body, "component not found") != null);
}
}
Loading