123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import React from 'react';
- import {shallow} from 'enzyme';
- import DetailedError from 'app/components/errors/detailedError';
- describe('DetailedError', function() {
- it('renders', function() {
- let wrapper = shallow(
- <DetailedError heading="Error heading" message={<div>Message</div>} />
- );
- expect(wrapper).toMatchSnapshot();
- });
- it('renders with "Retry" button', function() {
- let wrapper = shallow(
- <DetailedError
- onRetry={() => {}}
- heading="Error heading"
- message={<div>Message</div>}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
- it('can hide support links', function() {
- let wrapper = shallow(
- <DetailedError
- hideSupportLinks
- onRetry={() => {}}
- heading="Error heading"
- message={<div>Message</div>}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
- it('hides footer when no "Retry" and no support links', function() {
- let wrapper = shallow(
- <DetailedError
- hideSupportLinks
- heading="Error heading"
- message={<div>Message</div>}
- />
- );
- expect(wrapper).toMatchSnapshot();
- });
- });
|