Added tests for action-parameter-factory-options

This commit is contained in:
Kir_Antipov 2024-01-10 14:03:28 +00:00
parent c4d70fd871
commit f9426336e6

View file

@ -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);
}
});
});
});