Skip to content

Commit

Permalink
Removed link and fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
balex committed Nov 8, 2023
1 parent 85075e8 commit 1c65b6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
7 changes: 0 additions & 7 deletions frontend/src/components/userDetail/headerProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { NextMappingLevel } from '../user/topBar';
import { UserOrganisations } from './userTeamsOrgs';
import { SectionMenu } from '../menu';
import OsmLogo from '../../assets/img/osm_logo.png';
import MissingMapsLogo from '../../assets/img/organizations/missingmaps.png';
import SlackLogo from '../../assets/img/icons/slack.png';
import OsmChaLogo from '../../assets/img/icons/osm-cha.png';
import HdycNeisOneLogo from '../../assets/img/icons/hdyc-neis-one.png';
Expand Down Expand Up @@ -68,12 +67,6 @@ export const SocialMedia = ({ data }) => {
{createLink('osm', data.username)}
</div>
</li>
<li className="dib mr4-ns mr2 cf f7">
<div className="mr2 h2">
<img className="h1 v-mid" src={MissingMapsLogo} alt="Missing Maps" />{' '}
{createLink('missingmaps', data.username)}
</div>
</li>
<li className="dib mr4-ns mr2 cf f7" title={intl.formatMessage(messages.osmChaUsername)}>
<div className="mr2 h2">
<img className="h1 v-mid" src={OsmChaLogo} alt="OSM Cha Logo" />{' '}
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/components/userDetail/tests/headerProfile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ describe('Social Media component', () => {
<SocialMedia data={mockData} />
</IntlProviders>,
);
// img tag for OSM, Missng Maps, Slack and HDYC Neis One
expect(screen.getAllByRole('img')).toHaveLength(5);
// img tag for OSM, Slack and HDYC Neis One
expect(screen.getAllByRole('img')).toHaveLength(4);
// SVGs for Facebook, Linkedin, Twitter
expect(container.querySelectorAll('svg').length).toBe(3);
});
Expand All @@ -43,20 +43,16 @@ describe('Social Media component', () => {
screen.getAllByRole('link', {
name: 'johndoe',
}),
).toHaveLength(4);
).toHaveLength(3);
expect(screen.queryAllByRole('link', { name: 'johndoe' })[0]).toHaveAttribute(
'href',
'https://www.openstreetmap.org/user/johndoe',
);
expect(screen.queryAllByRole('link', { name: 'johndoe' })[1]).toHaveAttribute(
'href',
'https://www.missingmaps.org/users/#/johndoe',
);
expect(screen.queryAllByRole('link', { name: 'johndoe' })[2]).toHaveAttribute(
'href',
'https://osmcha.org/?filters={"users":[{"label":"johndoe","value":"johndoe"}]}',
);
expect(screen.getAllByRole('link', { name: 'johndoe' })[3]).toHaveAttribute(
expect(screen.getAllByRole('link', { name: 'johndoe' })[2]).toHaveAttribute(
'href',
'https://hdyc.neis-one.org/?johndoe',
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/tests/contributions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('Contributions Page Index', () => {
</ReduxIntlProviders>
</QueryClientProviders>,
);
expect(screen.getAllByRole('link', { name: 'test_user' }).length).toBe(4);
expect(screen.getAllByRole('link', { name: 'test_user' }).length).toBe(3);
});
});

Expand Down

0 comments on commit 1c65b6f

Please sign in to comment.