]> cat aescling's git repositories - mastodon.git/commitdiff
use ES6 arrow functions
authorKai Schaper <303@posteo.de>
Mon, 10 Oct 2016 20:46:37 +0000 (22:46 +0200)
committerKai Schaper <303@posteo.de>
Mon, 10 Oct 2016 20:48:58 +0000 (22:48 +0200)
spec/javascript/components/avatar.test.jsx
spec/javascript/components/button.test.jsx
spec/javascript/components/loading_indicator.test.jsx

index f69b538a26ee76cc7d5d304515d6372a299b544e..79b7d02f467628a340ca14bc0753377ca39b68b1 100644 (file)
@@ -3,8 +3,8 @@ import { render } from 'enzyme';
 
 import Avatar from '../../../app/assets/javascripts/components/components/avatar'
 
-describe('<Avatar />', function() {
-  it('renders an img with the given src', function() {
+describe('<Avatar />', () => {
+  it('renders an img with the given src', () => {
     const src = '/path/to/image.jpg';
     const wrapper = render(<Avatar src={src} size={100} />);
     expect(wrapper.find(`img[src="${src}"]`)).to.have.length(1);
index 5610e67dd2e9ce71a62b6e935cc47c9428d8fb1f..0f16ebe8ed55f9ae2cbe1722501add41392a4659 100644 (file)
@@ -4,8 +4,8 @@ import sinon from 'sinon';
 
 import Button from '../../../app/assets/javascripts/components/components/button'
 
-describe('<Button />', function() {
-  it('simulates click events', function() {
+describe('<Button />', () => {
+  it('simulates click events', () => {
     const onClick = sinon.spy();
     const wrapper = shallow(<Button onClick={onClick} />);
     wrapper.find('button').simulate('click');
index e62288405576580422157d14cd882aa0aa6bf4f1..7039dbfbd430f04aff309f3d335fde669706440e 100644 (file)
@@ -3,8 +3,8 @@ import { shallow } from 'enzyme';
 
 import LoadingIndicator from '../../../app/assets/javascripts/components/components/loading_indicator'
 
-describe('<LoadingIndicator />', function() {
-  it('renders text that indicates loading', function() {
+describe('<LoadingIndicator />', () => {
+  it('renders text that indicates loading', () => {
     const wrapper = shallow(<LoadingIndicator />);
     expect(wrapper.text()).to.match(/loading/i);
   });