Use the user-provided source name in SourceInfoCard (#103542)

This commit is contained in:
Vadim Yakhin 2021-06-29 11:39:04 -03:00 committed by GitHub
parent a416e81b49
commit 51767e7cb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View file

@ -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 />);

View file

@ -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}