mirror of
https://github.com/SomboChea/ui
synced 2024-11-28 00:44:30 +07:00
chore(#207): added more descriptive tests
This commit is contained in:
parent
f5c77ff43c
commit
ff791a35f7
@ -2,10 +2,26 @@ import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import Spinner from './Spinner';
|
||||
import { Circular, Wrapper } from './styles';
|
||||
|
||||
describe('<Spinner /> component', () => {
|
||||
test('should render the component in default state', () => {
|
||||
const wrapper = shallow(<Spinner />);
|
||||
const wrapperComponent = wrapper.find(Wrapper);
|
||||
const circular = wrapper.find(Circular);
|
||||
|
||||
expect(circular.props().size).toBe(50);
|
||||
expect(wrapperComponent.props().centered).toBe(false);
|
||||
});
|
||||
|
||||
test('should render the component in custom state', () => {
|
||||
const wrapper = shallow(<Spinner centered={true} size={10} />);
|
||||
const wrapperComponent = wrapper.find(Wrapper);
|
||||
const circular = wrapper.find(Circular);
|
||||
|
||||
expect(circular.props().size).toBe(10);
|
||||
expect(wrapperComponent.props().centered).toBe(true);
|
||||
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
@ -1,3 +1,3 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<Spinner /> component should render the component in default state 1`] = `"<div class=\\"css-vqrgi e1ag4h8b0\\"><div class=\\"MuiCircularProgress-root css-15gl0ho e1ag4h8b1 MuiCircularProgress-colorPrimary MuiCircularProgress-indeterminate\\" style=\\"width:50px;height:50px\\" role=\\"progressbar\\"><svg class=\\"MuiCircularProgress-svg\\" viewBox=\\"22 22 44 44\\"><circle class=\\"MuiCircularProgress-circle MuiCircularProgress-circleIndeterminate\\" cx=\\"44\\" cy=\\"44\\" r=\\"20.2\\" fill=\\"none\\" stroke-width=\\"3.6\\"></circle></svg></div></div>"`;
|
||||
exports[`<Spinner /> component should render the component in custom state 1`] = `"<div class=\\"css-zo92co e1ag4h8b0\\"><div class=\\"MuiCircularProgress-root css-15gl0ho e1ag4h8b1 MuiCircularProgress-colorPrimary MuiCircularProgress-indeterminate\\" style=\\"width:10px;height:10px\\" role=\\"progressbar\\"><svg class=\\"MuiCircularProgress-svg\\" viewBox=\\"22 22 44 44\\"><circle class=\\"MuiCircularProgress-circle MuiCircularProgress-circleIndeterminate\\" cx=\\"44\\" cy=\\"44\\" r=\\"20.2\\" fill=\\"none\\" stroke-width=\\"3.6\\"></circle></svg></div></div>"`;
|
||||
|
Loading…
Reference in New Issue
Block a user