Skip to content

Commit

Permalink
Merge branch 'main' into ProgressIndicator-Skeleton-testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
mariat189 authored Oct 25, 2024
2 parents b80eedc + f4f3dfe commit 52167f7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,15 @@
"code"
]
},
{
"login": "irfadkp",
"name": "IRFAD KP",
"avatar_url": "https://avatars.githubusercontent.com/u/54243898?v=4",
"profile": "https://irfadkp.github.io/",
"contributions": [
"code"
]
},
{
"login": "ziyadzulfikar",
"name": "ziyadzulfikar",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
<td align="center"><a href="https://github.com/Neues"><img src="https://avatars.githubusercontent.com/u/9409245?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Noah Sgorbati</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=Neues" title="Code">💻</a> <a href="https://github.com/carbon-design-system/carbon/commits?author=Neues" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/divya-281"><img src="https://avatars.githubusercontent.com/u/72991264?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Divya G</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=divya-281" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/soumyaraju"><img src="https://avatars.githubusercontent.com/u/41182657?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Soumya Raju</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=soumyaraju" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ziyadzulfikar"><img src="https://avatars.githubusercontent.com/u/56788667?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ziyadzulfikar</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=ziyadzulfikar" title="Code">💻</a></td>
<td align="center"><a href="https://irfadkp.github.io/"><img src="https://avatars.githubusercontent.com/u/54243898?v=4?s=100" width="100px;" alt=""/><br /><sub><b>IRFAD KP</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=irfadkp" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ziyadzulfikar"><img src="https://avatars.githubusercontent.com/u/56788667?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ziyad Bin Sulfi</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=ziyadzulfikar" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://irfadkp.github.io/"><img src="https://avatars.githubusercontent.com/u/54243898?v=4?s=100" width="100px;" alt=""/><br /><sub><b>IRFAD KP</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=irfadkp" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mariat189"><img src="https://avatars.githubusercontent.com/u/74430463?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mariat</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=mariat189" title="Code">💻</a></td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { render, screen } from '@testing-library/react';

import FluidNumberInputSkeleton from '../FluidNumberInput.Skeleton';
import React from 'react';

describe('FluidNumberInputSkeleton', () => {
it('should render with the appropriate skeleton classes', () => {
const { container } = render(<FluidNumberInputSkeleton />);

const skeletonWrapper = container.firstChild;
expect(skeletonWrapper).toHaveClass(
'cds--form-item',
'cds--text-input--fluid__skeleton'
);

const labelSkeleton = container.querySelector('.cds--label.cds--skeleton');
expect(labelSkeleton).toBeInTheDocument();

const inputSkeleton = container.querySelector(
'.cds--skeleton.cds--text-input'
);
expect(inputSkeleton).toBeInTheDocument();
});

it('should apply custom className to the outermost element', () => {
const { container } = render(
<FluidNumberInputSkeleton className="custom-class" />
);
expect(container.firstChild).toHaveClass('custom-class');
});

it('should spread extra props onto the outermost element', () => {
render(<FluidNumberInputSkeleton data-testid="test-skeleton" />);
expect(screen.getByTestId('test-skeleton')).toBeInTheDocument();
});
});

0 comments on commit 52167f7

Please sign in to comment.