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

40 lines
1.6 KiB
TypeScript

import * as AWS from "@/AWS";
import { AlarmMuteRule } from "@/AWS/CloudWatch";
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).
//
// `AlarmMuteRule` is enumerable: `listAlarmMuteRules` paginates every mute
// rule in the region (verified live). `list()` flattens those summaries,
// derives the name from each ARN, and re-reads each rule via
// `getAlarmMuteRule` to return the full `Attributes` shape (identical to
// `read`).
//
// NOTE: We do not deploy a rule first because `putAlarmMuteRule` currently
// rejects every input with an (empty-message) `ValidationException` — a
// separate create-path blocker independent of `list()`. We therefore verify
// `list()` runs against the live API and returns the well-typed `Attributes`
// array. When create is unblocked, the deploy-and-find-it assertion below can
// be re-enabled.
test.provider(
"list enumerates alarm mute rules in the region",
(stack) =>
Effect.gen(function* () {
yield* stack.destroy();
const provider = yield* Provider.findProvider(AlarmMuteRule);
const all = yield* provider.list();
expect(Array.isArray(all)).toBe(true);
for (const rule of all) {
expect(typeof rule.alarmMuteRuleName).toBe("string");
expect(rule.alarmMuteRuleArn).toContain(":alarm-mute-rule:");
}
}),
{ tags: ["provider:aws", "provider:aws:cloudwatch", "live"] },
);