• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / crdc-datahub-ui / 13768297073

10 Mar 2025 03:20PM UTC coverage: 59.96% (-0.3%) from 60.271%
13768297073

Pull #642

github

web-flow
Merge ccb08cb24 into 922b0b29f
Pull Request #642: CRDCDH-2458 Setup Storybook

3139 of 5627 branches covered (55.78%)

Branch coverage included in aggregate %.

3 of 69 new or added lines in 16 files covered. (4.35%)

4374 of 6903 relevant lines covered (63.36%)

145.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/components/GenericTable/index.stories.tsx
1
import type { Meta, StoryObj } from "@storybook/react";
2
import GenericTable from "./index";
3
import { SearchParamsProvider } from "../Contexts/SearchParamsContext";
4

NEW
5
const meta: Meta<typeof GenericTable> = {
×
6
  title: "Miscellaneous / Generic Table",
7
  component: GenericTable,
8
  parameters: {
9
    layout: "centered",
10
  },
11
  decorators: [
12
    (Story) => (
NEW
13
      <SearchParamsProvider>
×
14
        <Story />
15
      </SearchParamsProvider>
16
    ),
17
  ],
18
  tags: ["autodocs"],
19
} satisfies Meta<typeof GenericTable>;
20

21
export default meta;
22
type Story = StoryObj<typeof meta>;
23

24
type ExampleDatasetType = {
25
  column1: string;
26
};
27

NEW
28
const exampleDataset: ExampleDatasetType[] = [
×
29
  {
30
    column1: "Row 1",
31
  },
32
  {
33
    column1: "Row 2",
34
  },
35
];
36

NEW
37
const exampleColumns = [
×
38
  {
39
    label: "Column #1",
NEW
40
    renderValue: (dataset: ExampleDatasetType) => dataset.column1,
×
41
  },
42
  {
43
    label: "Column #2",
NEW
44
    renderValue: (dataset: ExampleDatasetType) => dataset.column1,
×
45
  },
46
  {
47
    label: "Column #3",
NEW
48
    renderValue: (dataset: ExampleDatasetType) => dataset.column1,
×
49
  },
50
  {
51
    label: "Column #4",
NEW
52
    renderValue: (dataset: ExampleDatasetType) => dataset.column1,
×
53
  },
54
];
55

NEW
56
export const Table: Story = {
×
57
  args: {
58
    columns: exampleColumns,
59
    data: exampleDataset,
60
    total: exampleDataset.length,
61
    loading: false,
62
  },
63
};
64

NEW
65
export const NoData: Story = {
×
66
  args: {
67
    columns: exampleColumns,
68
    data: [],
69
    total: 0,
70
    loading: false,
71
  },
72
};
73

NEW
74
export const Loading: Story = {
×
75
  args: {
76
    columns: exampleColumns,
77
    data: [],
78
    total: 0,
79
    numRowsNoContent: 4,
80
    loading: true,
81
  },
82
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc