Reworking internal component naming for clarity
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
exports[`SentryError rendering 1`] = `
|
||||
ShallowWrapper {
|
||||
Symbol(enzyme.__root__): [Circular],
|
||||
Symbol(enzyme.__unrendered__): <SentryErrorImpl
|
||||
Symbol(enzyme.__unrendered__): <SentryError
|
||||
t={[Function]}
|
||||
/>,
|
||||
Symbol(enzyme.__renderer__): Object {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { withNamespaces, Trans } from 'react-i18next';
|
||||
|
||||
import Message from 'components/Message';
|
||||
|
||||
export class SentryErrorImpl extends React.Component {
|
||||
export class SentryError extends React.Component {
|
||||
reportError = event => {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -26,8 +26,8 @@ export class SentryErrorImpl extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
SentryErrorImpl.propTypes = {
|
||||
SentryError.propTypes = {
|
||||
t: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default withNamespaces()(SentryErrorImpl);
|
||||
export default withNamespaces()(SentryError);
|
||||
|
||||
@@ -5,12 +5,12 @@ import { shallow } from 'enzyme';
|
||||
import * as Sentry from '@sentry/browser';
|
||||
|
||||
import { mockT } from 'i18n';
|
||||
import { SentryErrorImpl } from 'components/SentryError';
|
||||
import { SentryError } from 'components/SentryError';
|
||||
|
||||
describe('SentryError', () => {
|
||||
test('rendering', () => {
|
||||
const component = shallow(
|
||||
<SentryErrorImpl t={ mockT }/>
|
||||
<SentryError t={ mockT }/>
|
||||
);
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
@@ -19,7 +19,7 @@ describe('SentryError', () => {
|
||||
test('fill out a report when an event has been logged', () => {
|
||||
Sentry.lastEventId.mockReturnValue(1);
|
||||
const component = shallow(
|
||||
<SentryErrorImpl t={ mockT } />
|
||||
<SentryError t={ mockT } />
|
||||
);
|
||||
const eventObj = { preventDefault: jest.fn() };
|
||||
component.find('a').simulate('click', eventObj);
|
||||
@@ -31,7 +31,7 @@ describe('SentryError', () => {
|
||||
test('fill out a report when an event has not been logged', () => {
|
||||
Sentry.lastEventId.mockReturnValue(false);
|
||||
const component = shallow(
|
||||
<SentryErrorImpl t={ mockT } />
|
||||
<SentryError t={ mockT } />
|
||||
);
|
||||
const eventObj = { preventDefault: jest.fn() };
|
||||
component.find('a').simulate('click', eventObj);
|
||||
|
||||
Reference in New Issue
Block a user