From f9426336e6733d324ea7fe81a78f8c4b23637102 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Wed, 10 Jan 2024 14:03:28 +0000 Subject: [PATCH] Added tests for `action-parameter-factory-options` --- .../action-parameter-factory-options.spec.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/unit/utils/actions/action-parameter-factory-options.spec.ts 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); + } + }); + }); +});