Files
mostlymatter/webapp/tests/components/spinner_button.test.jsx
Harrison Healey fb6f2a123c PLT-5860 Updated copyright date (#6058)
* PLT-5860 Updated copyright date in about modal

* PLT-5860 Updated copyright notice in JSX files

* PLT-5860 Updated copyright notice in go files

* Fixed misc copyright dates

* Fixed component snapshots
2017-04-12 08:27:57 -04:00

54 строки
1.4 KiB
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
import {shallow, mount} from 'enzyme';
import SpinnerButton from 'components/spinner_button.jsx';
describe('components/SpinnerButton', () => {
test('should match snapshot with required props', () => {
const wrapper = shallow(
<SpinnerButton
spinning={false}
/>
);
expect(wrapper).toMatchSnapshot();
});
test('should match snapshot with spinning', () => {
const wrapper = shallow(
<SpinnerButton
spinning={true}
/>
);
expect(wrapper).toMatchSnapshot();
});
test('should match snapshot with children', () => {
const wrapper = shallow(
<SpinnerButton
spinning={false}
>
<span id='child1'/>
<span id='child2'/>
</SpinnerButton>
);
expect(wrapper).toMatchSnapshot();
});
test('should handle onClick', (done) => {
function onClick() {
done();
}
const wrapper = mount(
<SpinnerButton
spinning={false}
onClick={onClick}
/>
);
wrapper.find('button').first().props().onClick();
});
});