t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/AWS/ApiGateway/Account.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

52 lines
1.6 KiB
TypeScript

import * as AWS from "@/AWS";
import * as Provider from "@/Provider";
import * as Test from "./Test.ts";
import * as ag from "@distilled.cloud/aws/api-gateway";
import { expect } from "alchemy-test";
import * as Effect from "effect/Effect";
const { test } = Test.make({ providers: AWS.providers() });
test.provider.skipIf(!!process.env.FAST)(
"patch API Gateway account settings",
(stack) =>
Effect.gen(function* () {
// Account settings are a singleton patch resource — the leading destroy
// clears any prior partial deployment before capturing the baseline.
yield* stack.destroy();
const before = yield* ag.getAccount({});
yield* stack.deploy(
Effect.gen(function* () {
yield* AWS.ApiGateway.Account("AgAccount", {});
return undefined;
}),
);
const account = yield* ag.getAccount({});
expect(account).toBeDefined();
yield* stack.destroy();
const after = yield* ag.getAccount({});
expect(after.cloudwatchRoleArn).toEqual(before.cloudwatchRoleArn);
}),
{ tags: ["provider:aws", "provider:aws:apigateway", "live"] },
);
test.provider.skipIf(!!process.env.FAST)(
"list returns the account settings singleton",
(stack) =>
Effect.gen(function* () {
const provider = yield* Provider.findProvider(AWS.ApiGateway.Account);
const all = yield* provider.list();
// Account settings are an account/region singleton — always exactly one.
expect(all.length).toBe(1);
expect(all[0]).toHaveProperty("managesCloudwatchRoleArn");
yield* stack.destroy();
}),
{ tags: ["provider:aws", "provider:aws:apigateway", "live"] },
);