Skip to content

Commit

Permalink
[PR feedback] Breadcrumb errors/fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jun 18, 2021
1 parent 8bea24e commit d77ee41
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ describe('AddSourceList', () => {
});
});

it('renders a breadcrumb fallback while data is loading', () => {
setMockValues({ ...mockValues, dataLoading: true, sourceConfigData: {} });
const wrapper = shallow(<AddSource sourceIndex={1} />);

expect(wrapper.prop('pageChrome')).toEqual(['Sources', 'Add Source', '...']);
});

it('renders Config Completed step', () => {
setMockValues({
...mockValues,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const AddSource: React.FC<AddSourceProps> = (props) => {
const Layout = isOrganization ? WorkplaceSearchPageTemplate : PersonalDashboardLayout;

return (
<Layout pageChrome={[NAV.SOURCES, NAV.ADD_SOURCE, name]} isLoading={dataLoading}>
<Layout pageChrome={[NAV.SOURCES, NAV.ADD_SOURCE, name || '...']} isLoading={dataLoading}>
{addSourceCurrentStep === AddSourceSteps.ConfigIntroStep && (
<ConfigurationIntro name={name} advanceStep={goToSaveConfig} header={header} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ describe('SourceConfig', () => {
expect(wrapper.find(EuiConfirmModal)).toHaveLength(1);
});

it('renders a breadcrumb fallback while data is loading', () => {
setMockValues({ dataLoading: true, sourceConfigData: {} });
const wrapper = shallow(<SourceConfig sourceIndex={1} />);

expect(wrapper.prop('pageChrome')).toEqual(['Settings', 'Content source connectors', '...']);
});

it('handles delete click', () => {
const wrapper = shallow(<SourceConfig sourceIndex={1} />);
const saveConfig = wrapper.find(SaveConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const SourceConfig: React.FC<SourceConfigProps> = ({ sourceIndex }) => {

return (
<WorkplaceSearchPageTemplate
pageChrome={[NAV.SETTINGS, NAV.SETTINGS_SOURCE_PRIORITIZATION, name]}
pageChrome={[NAV.SETTINGS, NAV.SETTINGS_SOURCE_PRIORITIZATION, name || '...']}
isLoading={dataLoading}
>
<SaveConfig
Expand Down

0 comments on commit d77ee41

Please sign in to comment.