generated from nhcarrigan/template
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
|
/**
|
||
|
* @copyright nhcarrigan
|
||
|
* @license Naomi's Public License
|
||
|
* @author Naomi Carrigan
|
||
|
*/
|
||
|
import { describe, it, expect } from "vitest";
|
||
|
import { Games } from "../../src/config/Games";
|
||
|
|
||
|
describe("games objects", () => {
|
||
|
it("should have unique names", () => {
|
||
|
expect.assertions(1);
|
||
|
const set = new Set(
|
||
|
Games.map((g) => {
|
||
|
return g.name;
|
||
|
}),
|
||
|
);
|
||
|
expect(set, "are not unique").toHaveLength(Games.length);
|
||
|
});
|
||
|
|
||
|
it("should have unique img properties", () => {
|
||
|
expect.assertions(1);
|
||
|
const set = new Set(
|
||
|
Games.map((g) => {
|
||
|
return g.img;
|
||
|
}),
|
||
|
);
|
||
|
expect(set, "are not unique").toHaveLength(Games.length);
|
||
|
});
|
||
|
|
||
|
it("should have unique urls", () => {
|
||
|
expect.assertions(1);
|
||
|
const set = new Set(
|
||
|
Games.map((g) => {
|
||
|
return g.url;
|
||
|
}),
|
||
|
);
|
||
|
expect(set, "are not unique").toHaveLength(Games.length);
|
||
|
});
|
||
|
|
||
|
it("should have alt text", () => {
|
||
|
expect.assertions(1);
|
||
|
const noText = Games.filter((g) => {
|
||
|
return g.alt.length === 0;
|
||
|
});
|
||
|
expect(noText, "found missing alt").toHaveLength(0);
|
||
|
});
|
||
|
});
|