diff --git a/src/containers/Sidebar.js b/src/containers/Sidebar.js index 377fde083..569d9670c 100644 --- a/src/containers/Sidebar.js +++ b/src/containers/Sidebar.js @@ -44,7 +44,7 @@ export class Sidebar extends Component { to={`${ADMIN_PREFIX}/collections/${col.label}`} > - {capitalize(col.label)} + {col.sidebar_label || capitalize(col.label)} ); diff --git a/src/containers/tests/__snapshots__/sidebar.spec.js.snap b/src/containers/tests/__snapshots__/sidebar.spec.js.snap index d3f314363..66fe60216 100644 --- a/src/containers/tests/__snapshots__/sidebar.spec.js.snap +++ b/src/containers/tests/__snapshots__/sidebar.spec.js.snap @@ -222,6 +222,139 @@ exports[`Containers::Sidebar renders correctly 1`] = ` `; +exports[`Containers::Sidebar renders with custom collection labels 1`] = ` +
+ + +
+`; + exports[`Containers::Sidebar renders with zero collections 1`] = `
{ expect(tree).toMatchSnapshot(); }); + it('renders with custom collection labels', () => { + const props = { + ...defaultProps, + collections: [ + { + label: 'walkthroughs', + sidebar_label: 'Tutorials', + }, + { + label: 'docs', + }, + ], + }; + + const tree = renderer.create().toJSON(); + expect(tree).toMatchSnapshot(); + }); + it('calls fetchCollections action after mounted', () => { expect(actions.fetchCollections).toHaveBeenCalled(); });