houdini/app/javascript/legacy_react/src/components/common/Spinner.spec.tsx

24 lines
645 B
TypeScript
Raw Normal View History

2019-04-19 20:27:56 +00:00
// License: LGPL-3.0-or-later
import * as React from 'react';
import 'jest';
import Spinner from './Spinner'
import { mount } from 'enzyme';
import toJson from 'enzyme-to-json';
describe('Spinner', () => {
test('is small', () => {
expect(toJson(mount(<Spinner size="small"/>))).toMatchSnapshot()
})
test('is normal', () => {
expect(toJson(mount(<Spinner size="normal"/>))).toMatchSnapshot()
})
test('is large', () => {
expect(toJson(mount(<Spinner size="large"/>))).toMatchSnapshot()
})
2019-04-19 20:31:07 +00:00
test('has custom color ', () => {
2019-04-19 20:27:56 +00:00
expect(toJson(mount(<Spinner size="small" color={"#ffffff"}/>))).toMatchSnapshot()
})
})