Skip to content

Commit

Permalink
Fix linter problems
Browse files Browse the repository at this point in the history
  • Loading branch information
danielevalverde committed Jan 21, 2025
1 parent 567950f commit 0053975
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/app/components/media/MediaOrigin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CheckMediaOrigin from '../../CheckMediaOrigin';

describe('<MediaOrigin />', () => {
it('should render a button with the correct icon and message for each type', () => {
const tiplineSubmitted = mountWithIntl(<MediaOrigin media_cluster_origin={CheckMediaOrigin.TIPLINE_SUBMITTED} media_cluster_origin_user="Smooch" />);
const tiplineSubmitted = mountWithIntl(<MediaOrigin media_cluster_origin={CheckMediaOrigin.TIPLINE_SUBMITTED} media_cluster_origin_user="Smooch" />);
expect(tiplineSubmitted.find(Tipline).length).toEqual(1);
expect(tiplineSubmitted.html()).toMatch('Tipline Submitted');

Expand All @@ -26,13 +26,13 @@ describe('<MediaOrigin />', () => {
expect(userMatched.find(PersonCheck).length).toEqual(1);
expect(userMatched.html()).toMatch('User Matched');

const autoMatched = mountWithIntl(<MediaOrigin media_cluster_origin={CheckMediaOrigin.AUTO_MATCHED} media_cluster_origin_user="Alegre"/>);
const autoMatched = mountWithIntl(<MediaOrigin media_cluster_origin={CheckMediaOrigin.AUTO_MATCHED} media_cluster_origin_user="Alegre" />);
expect(autoMatched.find(Bolt).length).toEqual(1);
expect(autoMatched.html()).toMatch('Auto Matched');
});

it('should return null for invalid type', () => {
const wrapper = mountWithIntl(<MediaOrigin media_cluster_origin={99} media_cluster_origin_user={'user'}/>);
const wrapper = mountWithIntl(<MediaOrigin media_cluster_origin={99} media_cluster_origin_user="user" />);
expect(wrapper.find('FormattedMessage').length).toEqual(0);
});
});
14 changes: 7 additions & 7 deletions src/app/components/media/MediaOriginBanner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ import CheckMediaOrigin from '../../CheckMediaOrigin';

describe('<MediaBanner />', () => {
const media_cluster_origin_timestamp = 1736876257;
const media_cluster_relationship ={ confirmed_by: {name: 'Cluster A'}, target: { title: 'Cluster B' }};
const media_cluster_relationship = { confirmed_by: { name: 'Cluster A' }, target: { title: 'Cluster B' } };
const media_cluster_origin_user = 'Bruce';
it('should render a banner with the correct icon and message for each type', () => {
const tiplineSubmitted = mountWithIntl(<MediaBanner media_cluster_relationship={media_cluster_relationship} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin={CheckMediaOrigin.TIPLINE_SUBMITTED} media_cluster_origin_user={media_cluster_origin_user} />);
const tiplineSubmitted = mountWithIntl(<MediaBanner media_cluster_origin={CheckMediaOrigin.TIPLINE_SUBMITTED} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin_user={media_cluster_origin_user} media_cluster_relationship={media_cluster_relationship} />);
expect(tiplineSubmitted.find(Tipline).length).toEqual(1);
expect(tiplineSubmitted.html()).toContain('This media was submitted via <strong>Tipline</strong>');

const userAdded = mountWithIntl(<MediaBanner media_cluster_relationship={media_cluster_relationship} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin={CheckMediaOrigin.USER_ADDED} media_cluster_origin_user={media_cluster_origin_user} />);
const userAdded = mountWithIntl(<MediaBanner media_cluster_origin={CheckMediaOrigin.USER_ADDED} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin_user={media_cluster_origin_user} media_cluster_relationship={media_cluster_relationship} />);
expect(userAdded.find(PersonAdd).length).toEqual(1);
expect(userAdded.html()).toContain('This media was added to the cluster by');

const userMerged = mountWithIntl(<MediaBanner media_cluster_relationship={media_cluster_relationship} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin={CheckMediaOrigin.USER_MERGED} media_cluster_origin_user={media_cluster_origin_user} />);
const userMerged = mountWithIntl(<MediaBanner media_cluster_origin={CheckMediaOrigin.USER_MERGED} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin_user={media_cluster_origin_user} media_cluster_relationship={media_cluster_relationship} />);
expect(userMerged.find(Person).length).toEqual(1);
expect(userMerged.html()).toContain('This media was merged to the cluster by');

const userMatched = mountWithIntl(<MediaBanner media_cluster_relationship={media_cluster_relationship} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin={CheckMediaOrigin.USER_MATCHED} media_cluster_origin_user={media_cluster_origin_user} />);
const userMatched = mountWithIntl(<MediaBanner media_cluster_origin={CheckMediaOrigin.USER_MATCHED} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin_user={media_cluster_origin_user} media_cluster_relationship={media_cluster_relationship} />);
expect(userMatched.find(PersonCheck).length).toEqual(1);
expect(userMatched.html()).toContain('This media was added to the cluster by');

const autoMatched = mountWithIntl(<MediaBanner media_cluster_relationship={media_cluster_relationship} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin={CheckMediaOrigin.AUTO_MATCHED} media_cluster_origin_user={media_cluster_origin_user} />);
const autoMatched = mountWithIntl(<MediaBanner media_cluster_origin={CheckMediaOrigin.AUTO_MATCHED} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin_user={media_cluster_origin_user} media_cluster_relationship={media_cluster_relationship} />);
expect(autoMatched.find(Bolt).length).toEqual(1);
expect(autoMatched.html()).toContain('This media was automatically matched to the cluster');
});

it('should return null for invalid type', () => {
const wrapper = mountWithIntl(<MediaBanner media_cluster_relationship={media_cluster_relationship} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin={99} media_cluster_origin_user={media_cluster_origin_user} />);
const wrapper = mountWithIntl(<MediaBanner media_cluster_origin={99} media_cluster_origin_timestamp={media_cluster_origin_timestamp} media_cluster_origin_user={media_cluster_origin_user} media_cluster_relationship={media_cluster_relationship} />);
expect(wrapper.find('FormattedMessage').length).toEqual(0);
});
});

0 comments on commit 0053975

Please sign in to comment.