test: Remove always-pass conditional guards in icon-integrity tests (#2214)

The `if (parsed.success)` and `if (id in SOURCES)` guards inside test
bodies were redundant — an `expect(...).toBe(true)` assertion always
precedes them, so the inner expects would only be skipped if the test
was already failing. Replace with early-return guards that make the
control flow explicit and remove the nested indirection.

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-05 04:51:52 -08:00 committed by GitHub
parent 02931cfa32
commit 475a1772a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,20 +63,23 @@ describe("Icon Integrity", () => {
it(`${id} manifest icon URL ends with .png`, () => {
const parsed = v.safeParse(IconEntry, manifest.agents[id]);
expect(parsed.success).toBe(true);
if (parsed.success) {
expect(parsed.output.icon).toEndWith(`${id}.png`);
if (!parsed.success) {
return;
}
expect(parsed.output.icon).toEndWith(`${id}.png`);
});
it(`${id} .sources.json ext is "png"`, () => {
expect(id in AGENT_SOURCES).toBe(true);
if (id in AGENT_SOURCES) {
const parsed = v.safeParse(SourceEntry, AGENT_SOURCES[id]);
expect(parsed.success).toBe(true);
if (parsed.success) {
expect(parsed.output.ext).toBe("png");
}
if (!(id in AGENT_SOURCES)) {
return;
}
const parsed = v.safeParse(SourceEntry, AGENT_SOURCES[id]);
expect(parsed.success).toBe(true);
if (!parsed.success) {
return;
}
expect(parsed.output.ext).toBe("png");
});
}
@ -111,13 +114,15 @@ describe("Icon Integrity", () => {
it(`${id} .sources.json ext is "png"`, () => {
expect(id in CLOUD_SOURCES).toBe(true);
if (id in CLOUD_SOURCES) {
const src = v.safeParse(SourceEntry, CLOUD_SOURCES[id]);
expect(src.success).toBe(true);
if (src.success) {
expect(src.output.ext).toBe("png");
}
if (!(id in CLOUD_SOURCES)) {
return;
}
const src = v.safeParse(SourceEntry, CLOUD_SOURCES[id]);
expect(src.success).toBe(true);
if (!src.success) {
return;
}
expect(src.output.ext).toBe("png");
});
}