portfolio/test/config/Legacy.spec.ts
Naomi Carrigan 054dcd7ad2
All checks were successful
Node.js CI / Lint and Test (push) Successful in 2m29s
feat: add images to and expand bios in legacy (#2)
### Explanation

It's about time we flesh this page out a bit.

### Issue

_No response_

### Attestations

- [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/)
- [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/).
- [x] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/).

### Dependencies

- [ ] I have pinned the dependencies to a specific patch version.

### Style

- [x] I have run the linter and resolved any errors.
- [x] My pull request uses an appropriate title, matching the conventional commit standards.
- [x] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request.

### Tests

- [x] My contribution adds new code, and I have added tests to cover it.
- [x] My contribution modifies existing code, and I have updated the tests to reflect these changes.
- [x] All new and existing tests pass locally with my changes.
- [x] Code coverage remains at or above the configured threshold.

### Documentation

_No response_

### Versioning

Minor - My pull request introduces a new non-breaking feature.

Reviewed-on: #2
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
2025-02-09 22:29:32 -08:00

46 lines
1.2 KiB
TypeScript

/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { describe, it, expect } from "vitest";
import { Characters } from "../../src/config/Legacy";
describe("character objects", () => {
it("should have unique names", () => {
expect.assertions(1);
const set = new Set(
Object.values(Characters).map((c) => {
return c.name;
}),
);
expect(set, "are not unique").toHaveLength(
Object.values(Characters).length,
);
});
it("should not have empty bios", () => {
expect.assertions(1);
const noBio = Object.values(Characters).filter((c) => {
return c.bio.length === 0;
});
expect(noBio, "found missing bio").toHaveLength(0);
});
it("should not have empty combat profiles", () => {
expect.assertions(1);
const noCombat = Object.values(Characters).filter((c) => {
return c.combat.length === 0;
});
expect(noCombat, "found missing combat").toHaveLength(0);
});
it("should have alt text", () => {
expect.assertions(1);
const noText = Object.values(Characters).filter((c) => {
return c.alt.length === 0;
});
expect(noText, "found missing alt").toHaveLength(0);
});
});