t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/AWS/RDS/DBClusterParameterGroup.test.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

51 lines
1.8 KiB
TypeScript

import * as AWS from "@/AWS";
import { DBClusterParameterGroup } from "@/AWS/RDS/DBClusterParameterGroup.ts";
import * as Provider from "@/Provider";
import * as Test from "@/Test/Alchemy";
import { expect } from "alchemy-test";
import * as Effect from "effect/Effect";
const { test } = Test.make({ providers: AWS.providers() });
// Canonical `list()` test (AWS account/region-scoped collection). Cluster
// parameter groups create and delete fast (well within the 240s budget), so we
// deploy a real group, resolve the provider via the typed
// `Provider.findProvider(DBClusterParameterGroup)` so `list()`'s element type is
// the exact `DBClusterParameterGroup["Attributes"]` shape, call it, and assert
// the deployed group appears in the exhaustively-paginated result.
test.provider(
"list enumerates the deployed DB cluster parameter group",
(stack) =>
Effect.gen(function* () {
yield* stack.destroy();
const group = yield* stack.deploy(
Effect.gen(function* () {
return yield* DBClusterParameterGroup("ListDBClusterParameterGroup", {
dbClusterParameterGroupName: "alchemy-test-dbcpg-list",
family: "aurora-postgresql16",
description: "Alchemy list() test cluster parameter group",
});
}),
);
const provider = yield* Provider.findProvider(DBClusterParameterGroup);
const all = yield* provider.list();
expect(Array.isArray(all)).toBe(true);
expect(
all.some(
(g) =>
g.dbClusterParameterGroupName === group.dbClusterParameterGroupName,
),
).toBe(true);
for (const g of all) {
expect(typeof g.dbClusterParameterGroupName).toBe("string");
expect(typeof g.family).toBe("string");
}
yield* stack.destroy();
}),
{ tags: ["provider:aws", "provider:aws:rds", "live"] },
);