Reworking internal component naming for clarity

This commit is contained in:
Jeff Avallone
2019-01-06 13:25:33 -05:00
parent 618b21bb93
commit bf35f26d5b
22 changed files with 79 additions and 243 deletions
@@ -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 {
+3 -3
View File
@@ -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);
+4 -4
View File
@@ -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);