diff --git a/tests/unit/utils/actions/action-parameter-factory-options.spec.ts b/tests/unit/utils/actions/action-parameter-factory-options.spec.ts new file mode 100644 index 0000000..a58352b --- /dev/null +++ b/tests/unit/utils/actions/action-parameter-factory-options.spec.ts @@ -0,0 +1,29 @@ +import { ActionParameterFactoryOptions } from "@/utils/actions/action-parameter-factory-options"; + +describe("ActionParameterFactoryOptions", () => { + describe("parse", () => { + test("parses all its own formatted values", () => { + for (const value of ActionParameterFactoryOptions.values()) { + expect(ActionParameterFactoryOptions.parse(ActionParameterFactoryOptions.format(value))).toBe(value); + } + }); + + test("parses all friendly names of its own values", () => { + for (const value of ActionParameterFactoryOptions.values()) { + expect(ActionParameterFactoryOptions.parse(ActionParameterFactoryOptions.friendlyNameOf(value))).toBe(value); + } + }); + + test("parses all its own formatted values in lowercase", () => { + for (const value of ActionParameterFactoryOptions.values()) { + expect(ActionParameterFactoryOptions.parse(ActionParameterFactoryOptions.format(value).toLowerCase())).toBe(value); + } + }); + + test("parses all its own formatted values in UPPERCASE", () => { + for (const value of ActionParameterFactoryOptions.values()) { + expect(ActionParameterFactoryOptions.parse(ActionParameterFactoryOptions.format(value).toUpperCase())).toBe(value); + } + }); + }); +});