Icons for genres with backgrounds, text, and ability to specify text color and font family (#34)

This commit is contained in:
Simon J
2021-08-27 18:14:09 +10:00
committed by GitHub
parent d1f00f549c
commit 29493e090a
38 changed files with 902 additions and 144 deletions

View File

@@ -1370,10 +1370,20 @@ describe("server", () => {
expect(response.status).toEqual(200);
const svg = Buffer.from(response.body).toString();
expect(svg).toContain(`fill:brightblue`);
expect(svg).toContain(`fill:brightpink`);
expect(svg).toContain(`fill="brightblue"`);
expect(svg).toContain(`fill="brightpink"`);
});
it("should return an icon with text if requested", async () => {
const response = await request(server(SystemClock)).get(
`/icon/${type}/size/180?text=foobar1000`
);
expect(response.status).toEqual(200);
const svg = Buffer.from(response.body).toString();
expect(svg).toContain(`foobar1000`);
});
it("should return a christmas icon on christmas day", async () => {
const response = await request(server({ now: () => dayjs("2022/12/25") })).get(
`/icon/${type}/size/180`
@@ -1381,8 +1391,8 @@ describe("server", () => {
expect(response.status).toEqual(200);
const svg = Buffer.from(response.body).toString();
expect(svg).toContain(`fill:red`);
expect(svg).toContain(`fill:green`);
expect(svg).toContain(`fill="red"`);
expect(svg).toContain(`fill="green"`);
});
});
});