♻️(react) remove faker usage from stories

Random data in stories was causing Chromatic to detect changes during
each build.
This commit is contained in:
Nathan Vasse
2024-03-18 16:32:01 +01:00
committed by NathanVss
parent f10e0e2fde
commit 9c614953b8
12 changed files with 50 additions and 78 deletions

View File

@@ -2,7 +2,6 @@ import { Meta, StoryFn } from "@storybook/react";
import React, { useRef, useState } from "react";
import { useForm, FormProvider } from "react-hook-form";
import * as Yup from "yup";
import { faker } from "@faker-js/faker";
import { yupResolver } from "@hookform/resolvers/yup";
import { onSubmit } from ":/components/Forms/Examples/ReactHookForm/reactHookFormUtils";
import { Select, SelectHandle } from ":/components/Forms/Select";
@@ -23,7 +22,18 @@ const Template: StoryFn<typeof Select> = (args) => (
</div>
);
const CITIES = Array.from({ length: 10 }).map(() => faker.location.city());
const CITIES = [
"Woodbury",
"Port Gayle",
"Geovannichester",
"San Rafael",
"Conradchester",
"Geraldinehaven",
"Bofield",
"East Ansel",
"New Carlo",
"West Minnieborough",
];
const OPTIONS = CITIES.map((city) => ({
label: city,
value: city.toLowerCase(),

View File

@@ -3,7 +3,6 @@ import { useForm, FormProvider } from "react-hook-form";
import * as Yup from "yup";
import { yupResolver } from "@hookform/resolvers/yup";
import { Meta, StoryFn } from "@storybook/react";
import { faker } from "@faker-js/faker";
import { onSubmit } from ":/components/Forms/Examples/ReactHookForm/reactHookFormUtils";
import { Select, SelectHandle } from ":/components/Forms/Select";
import { Button } from ":/components/Button";
@@ -25,7 +24,18 @@ const Template: StoryFn<typeof Select> = (args) => {
);
};
const CITIES = Array.from({ length: 10 }).map(() => faker.location.city());
const CITIES = [
"Woodbury",
"Port Gayle",
"Geovannichester",
"San Rafael",
"Conradchester",
"Geraldinehaven",
"Bofield",
"East Ansel",
"New Carlo",
"West Minnieborough",
];
const OPTIONS = CITIES.map((city) => ({
label: city,
value: city.toLowerCase(),