dhre-component-lib 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhre-component-lib",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -17,14 +17,6 @@ describe('Badge Component', () => {
17
17
  expect(badgeElement).toBeInTheDocument();
18
18
  });
19
19
 
20
- it('applies the correct className to the badge', () => {
21
- render(<Badge {...defaultProps} />);
22
-
23
- const badgeElement = screen.getByText(defaultProps.content as string);
24
-
25
- expect(badgeElement).toHaveClass(defaultProps.badgeClassName);
26
- });
27
-
28
20
  it('handles the onClick event correctly', () => {
29
21
  const handleClick = jest.fn();
30
22
  render(<Badge {...defaultProps} handleClick={handleClick} />);
@@ -13,9 +13,10 @@ describe('Button Component', () => {
13
13
  const renderButton = (props: Partial<ButtonProps> = {}) => {
14
14
  const defaultProps: ButtonProps = {
15
15
  label: 'Click Me',
16
- labelClassName: 'button-class',
17
- handleClick, // Use the mocked handleClick function here
18
- ...props, // Allow overriding props for specific tests
16
+ variant: 'contained',
17
+ color: 'primary',
18
+ size: 'small',
19
+ handleClick: handleClick
19
20
  };
20
21
 
21
22
  return render(<Button {...defaultProps} />);
@@ -30,14 +31,6 @@ describe('Button Component', () => {
30
31
  expect(buttonElement.tagName).toBe('BUTTON');
31
32
  });
32
33
 
33
- it('applies the correct className to the button', () => {
34
- renderButton();
35
-
36
- const buttonElement = screen.getByText('Click Me');
37
-
38
- expect(buttonElement).toHaveClass('button-class');
39
- });
40
-
41
34
  it('calls the handleClick function when the button is clicked', () => {
42
35
  renderButton();
43
36
 
@@ -53,14 +46,4 @@ describe('Button Component', () => {
53
46
 
54
47
  expect(handleClick).not.toHaveBeenCalled();
55
48
  });
56
-
57
- it('renders correctly with a different label', () => {
58
- const newLabel = 'Submit';
59
- renderButton({ label: newLabel });
60
-
61
- const buttonElement = screen.getByText(newLabel);
62
-
63
- expect(buttonElement).toBeInTheDocument();
64
- expect(buttonElement.tagName).toBe('BUTTON');
65
- });
66
49
  });
@@ -6,14 +6,6 @@ describe("Loading Component", () => {
6
6
  const renderComponent = (props: CircularProgressProps) =>
7
7
  render(<CircularProgress {...props} />);
8
8
 
9
- it("applies the correct color class", () => {
10
- const { container } = renderComponent({ color: "success" });
11
- const spinner = container.firstChild as HTMLElement;
12
-
13
- expect(spinner).not.toBeNull();
14
- expect(spinner.className).toContain("success");
15
- });
16
-
17
9
  it("applies the correct size and thickness", () => {
18
10
  const { container } = renderComponent({ size: 60, thickness: 5 });
19
11
  const spinner = container.firstChild as HTMLElement;
@@ -53,15 +53,4 @@ describe('CustomRadioButton', () => {
53
53
 
54
54
  expect(handleChange).toHaveBeenCalled();
55
55
  });
56
-
57
- it('should render without crashing if no props are provided', () => {
58
- render(<CustomRadioButton name="testName" value="testValue" />);
59
-
60
- const radioInput = screen.getByRole('radio');
61
- // Ensure that the label is associated with the radio input
62
- const label = screen.getByText('testValue');
63
-
64
- expect(radioInput).toBeInTheDocument();
65
- expect(label).toBeInTheDocument();
66
- });
67
56
  });
package/tsconfig.json CHANGED
@@ -103,7 +103,6 @@
103
103
 
104
104
  // Added
105
105
  "jsx": "react",
106
- "module": "ESNext",
107
106
  "declarationDir": "types",
108
107
  "sourceMap": true,
109
108
  "outDir": "./dist",
@@ -114,7 +113,9 @@
114
113
  "resolveJsonModule": true,
115
114
  "experimentalDecorators": true,
116
115
  "emitDecoratorMetadata": true,
116
+ "module": "commonjs",
117
+ "allowJs": true,
117
118
  },
118
119
  "include": ["src/**/*"],
119
- "exclude": ["node_modules", "**/*.test.tsx"]
120
+ "exclude": ["node_modules", "**/*.test.tsx", "dist"]
120
121
  }