mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
test(components): add InlineLoading, Loading unit tests
This commit is contained in:
parent
68622ba613
commit
1077eef283
2 changed files with 36 additions and 0 deletions
18
src/components/Loading/Loading.test.js
Normal file
18
src/components/Loading/Loading.test.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { render } from '@testing-library/svelte';
|
||||
import Component from './Loading.svelte';
|
||||
|
||||
test('Loading', () => {
|
||||
const { container, rerender } = render(Component);
|
||||
|
||||
let element = container.querySelector('.bx--loading-overlay');
|
||||
|
||||
expect(element).toBeInTheDocument();
|
||||
expect(element).not.toHaveClass('bx--loading-overlay--stop');
|
||||
expect(element.querySelector('.bx--loading__stroke')).toHaveAttribute('r', '37.5');
|
||||
|
||||
rerender({ props: { active: false, small: true, withOverlay: false } });
|
||||
|
||||
element = container.querySelector('.bx--loading');
|
||||
expect(element).toHaveClass('bx--loading--small', 'bx--loading--stop');
|
||||
expect(element.querySelector('.bx--loading__background')).toHaveAttribute('r', '26.8125');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue