Skip to content

Commit

Permalink
refactor data
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjwatkins committed Jan 14, 2025
1 parent da5217e commit 54148e0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
24 changes: 1 addition & 23 deletions easy-ui-react/src/MultiSelect/MultiSelect.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
useFilter,
useListData,
} from "./MultiSelect";
import { fruits } from "./MultiSelect.test";

type Story = StoryObj<typeof MultiSelect>;

Expand All @@ -33,29 +34,6 @@ const meta: Meta<typeof MultiSelect> = {

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<Item[]>([
Expand Down
29 changes: 23 additions & 6 deletions easy-ui-react/src/MultiSelect/MultiSelect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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("<MultiSelect />", () => {
let restoreGetComputedStyle: () => void;

Expand Down Expand Up @@ -56,12 +79,6 @@ describe("<MultiSelect />", () => {
});
});

const fruits = [
{ key: 1, label: "Apple" },
{ key: 2, label: "Banana" },
{ key: 3, label: "Cherry" },
] as const satisfies Item[];

const getMultiSelect = ({
initialSelectedItems = [],
}: {
Expand Down

0 comments on commit 54148e0

Please sign in to comment.