Skip to content

Commit

Permalink
Use the user-provided source name in SourceInfoCard (elastic#103542)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakhinvadim authored Jun 29, 2021
1 parent a416e81 commit 51767e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ describe('SourceLayout', () => {
expect(wrapper.find('.testChild')).toHaveLength(1);
});

it('passes a source name to SourceInfoCard', () => {
const wrapper = shallow(<SourceLayout />);

expect(wrapper.find(SourceInfoCard).prop('sourceName')).toEqual('Jira');
});

it('renders the default Workplace Search layout when on an organization view', () => {
setMockValues({ ...mockValues, isOrganization: true });
const wrapper = shallow(<SourceLayout />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,12 @@ export const SourceLayout: React.FC<PageTemplateProps> = ({
const { contentSource, dataLoading } = useValues(SourceLogic);
const { isOrganization } = useValues(AppLogic);

const {
name,
createdAt,
serviceType,
serviceName,
isFederatedSource,
supportedByLicense,
} = contentSource;
const { name, createdAt, serviceType, isFederatedSource, supportedByLicense } = contentSource;

const pageHeader = (
<>
<SourceInfoCard
sourceName={serviceName}
sourceName={name}
sourceType={serviceType}
dateCreated={moment(createdAt).format('MMMM D, YYYY')}
isFederatedSource={isFederatedSource}
Expand Down

0 comments on commit 51767e7

Please sign in to comment.