diff --git a/easy-ui-react/src/MultiSelect/MultiSelect.stories.tsx b/easy-ui-react/src/MultiSelect/MultiSelect.stories.tsx index ccae53fb..f3958c0f 100644 --- a/easy-ui-react/src/MultiSelect/MultiSelect.stories.tsx +++ b/easy-ui-react/src/MultiSelect/MultiSelect.stories.tsx @@ -14,6 +14,7 @@ import { useFilter, useListData, } from "./MultiSelect"; +import { fruits } from "./MultiSelect.test"; type Story = StoryObj; @@ -33,29 +34,6 @@ const meta: Meta = { export default meta; -const fruits = [ - { key: 1, label: "Apple" }, - { key: 2, label: "Banana" }, - { key: 3, label: "Cherry" }, - { key: 4, label: "Date" }, - { key: 5, label: "Elderberry" }, - { key: 6, label: "Fig" }, - { key: 7, label: "Grape" }, - { key: 8, label: "Honeydew" }, - { key: 9, label: "Kiwi" }, - { key: 10, label: "Lemon" }, - { key: 11, label: "Mango" }, - { key: 12, label: "Nectarine" }, - { key: 13, label: "Orange" }, - { key: 14, label: "Papaya" }, - { key: 15, label: "Quince" }, - { key: 16, label: "Raspberry" }, - { key: 17, label: "Strawberry" }, - { key: 18, label: "Tangerine" }, - { key: 19, label: "Ugli Fruit" }, - { key: 20, label: "Watermelon" }, -] as const satisfies Item[]; - export const StandardDropdown: Story = { render: () => { const [selectedItems, setSelectedItems] = React.useState([ diff --git a/easy-ui-react/src/MultiSelect/MultiSelect.test.tsx b/easy-ui-react/src/MultiSelect/MultiSelect.test.tsx index f2772d09..c8f5cdb5 100644 --- a/easy-ui-react/src/MultiSelect/MultiSelect.test.tsx +++ b/easy-ui-react/src/MultiSelect/MultiSelect.test.tsx @@ -5,6 +5,29 @@ import { vi } from "vitest"; import { mockGetComputedStyle, render, userClick } from "../utilities/test"; import { Item, MultiSelect, useFilter, useListData } from "./MultiSelect"; +export const fruits = [ + { key: 1, label: "Apple" }, + { key: 2, label: "Banana" }, + { key: 3, label: "Cherry" }, + { key: 4, label: "Date" }, + { key: 5, label: "Elderberry" }, + { key: 6, label: "Fig" }, + { key: 7, label: "Grape" }, + { key: 8, label: "Honeydew" }, + { key: 9, label: "Kiwi" }, + { key: 10, label: "Lemon" }, + { key: 11, label: "Mango" }, + { key: 12, label: "Nectarine" }, + { key: 13, label: "Orange" }, + { key: 14, label: "Papaya" }, + { key: 15, label: "Quince" }, + { key: 16, label: "Raspberry" }, + { key: 17, label: "Strawberry" }, + { key: 18, label: "Tangerine" }, + { key: 19, label: "Ugli Fruit" }, + { key: 20, label: "Watermelon" }, +] as const satisfies Item[]; + describe("", () => { let restoreGetComputedStyle: () => void; @@ -56,12 +79,6 @@ describe("", () => { }); }); -const fruits = [ - { key: 1, label: "Apple" }, - { key: 2, label: "Banana" }, - { key: 3, label: "Cherry" }, -] as const satisfies Item[]; - const getMultiSelect = ({ initialSelectedItems = [], }: {