Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed link and fixed tests #6135

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading