use-wizard
Version:
A dead-easy-to-use light-weight react hook to handle multi-paths wizards (and simple wizards too) and navigate into them.
31 lines (22 loc) • 677 B
JavaScript
const {getWizardStrategy} = require("../lib/cjs/useWizard/dependencies/getWizardStrategy");
test("Simple strategy with no option", () => {
const a = getWizardStrategy();
expect(a).toBe("simple");
});
test("Simple strategy with a first step", () => {
const a = getWizardStrategy(4);
expect(a).toBe("simple");
});
test("Complex wizard with linear strategy", () => {
const a = getWizardStrategy(["a", "b", "c"]);
expect(a).toBe("complex");
});
test("Complex wizard from double nested path", () => {
const a = getWizardStrategy(["a", "b", "c", {
"1": ["d", "e", {
"1": ["i", "j"]
}],
"2": ["g", "h"],
}]);
expect(a).toBe("complex");
});