diff --git a/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap b/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap index c733309a43..9fe1f038fa 100644 --- a/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/ChallengeTile/__snapshots__/index.jsx.snap @@ -241,9 +241,6 @@ exports[`renders marathon 1`] = `

-

diff --git a/src/shared/components/ChallengeTile/index.jsx b/src/shared/components/ChallengeTile/index.jsx index c1611df3dd..0dbc7b7a22 100644 --- a/src/shared/components/ChallengeTile/index.jsx +++ b/src/shared/components/ChallengeTile/index.jsx @@ -2,6 +2,7 @@ * Challenge tile. */ /* eslint-env browser */ +import _ from 'lodash'; import React from 'react'; import PT from 'prop-types'; import { Link } from 'react-router-dom'; @@ -74,6 +75,7 @@ class ChallengeTile extends React.Component { } = this.props; const { track, type } = challenge; + const roles = _.get(challenge, 'userDetails.roles'); const outStyleName = `challenge tile-view ${track.replace(' ', '-').toLowerCase()}`; const extraStyle = { @@ -307,19 +309,22 @@ class ChallengeTile extends React.Component { ) } -

- { track !== COMPETITION_TRACKS.DS + { !_.isEmpty(roles) + && ( +

+ { track !== COMPETITION_TRACKS.DS && ( Role:   - { listRoles(challenge.userDetails.roles) } + { listRoles(roles) } ) } -

+

+ ) }