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

@@ -132,7 +132,9 @@ describe("config", () => {
describe("when BONOB_ICON_FOREGROUND_COLOR is an invalid string", () => {
it(`should blow up`, () => {
process.env["BONOB_ICON_FOREGROUND_COLOR"] = "#dfasd";
expect(() => config()).toThrow("Invalid color specified for BONOB_ICON_FOREGROUND_COLOR")
expect(() => config()).toThrow(
"Invalid color specified for BONOB_ICON_FOREGROUND_COLOR"
);
});
});
});
@@ -161,11 +163,75 @@ describe("config", () => {
describe("when BONOB_ICON_BACKGROUND_COLOR is an invalid string", () => {
it(`should blow up`, () => {
process.env["BONOB_ICON_BACKGROUND_COLOR"] = "#red";
expect(() => config()).toThrow("Invalid color specified for BONOB_ICON_BACKGROUND_COLOR")
expect(() => config()).toThrow(
"Invalid color specified for BONOB_ICON_BACKGROUND_COLOR"
);
});
});
});
});
describe("fontColor", () => {
describe("when BONOB_ICON_FONT_COLOR is not specified", () => {
it(`should default to undefined`, () => {
expect(config().icons.fontColor).toEqual(undefined);
});
});
describe("when BONOB_ICON_FONT_COLOR is ''", () => {
it(`should default to undefined`, () => {
process.env["BONOB_ICON_FONT_COLOR"] = "";
expect(config().icons.fontColor).toEqual(undefined);
});
});
describe("when BONOB_ICON_FONT_COLOR is specified", () => {
it(`should use it`, () => {
process.env["BONOB_ICON_FONT_COLOR"] = "pink";
expect(config().icons.fontColor).toEqual("pink");
});
});
describe("when BONOB_ICON_FONT_COLOR is an invalid string", () => {
it(`should blow up`, () => {
process.env["BONOB_ICON_FONT_COLOR"] = "#dfasd";
expect(() => config()).toThrow(
"Invalid color specified for BONOB_ICON_FONT_COLOR"
);
});
});
});
describe("fontFamily", () => {
describe("when BONOB_ICON_FONT_FAMILY is not specified", () => {
it(`should default to undefined`, () => {
expect(config().icons.fontFamily).toEqual(undefined);
});
});
describe("when BONOB_ICON_FONT_FAMILY is ''", () => {
it(`should default to undefined`, () => {
process.env["BONOB_ICON_FONT_FAMILY"] = "";
expect(config().icons.fontFamily).toEqual(undefined);
});
});
describe("when BONOB_ICON_FONT_FAMILY is specified", () => {
it(`should use it`, () => {
process.env["BONOB_ICON_FONT_FAMILY"] = "helveta";
expect(config().icons.fontFamily).toEqual("helveta");
});
});
describe("when BONOB_ICON_FONT_FAMILY is an invalid string", () => {
it(`should blow up`, () => {
process.env["BONOB_ICON_FONT_FAMILY"] = "#dfasd";
expect(() => config()).toThrow(
"Invalid color specified for BONOB_ICON_FONT_FAMILY"
);
});
});
});
});
describe("secret", () => {
it("should default to bonob", () => {