Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson committed Jun 6, 2024
1 parent 417e5d2 commit a323be8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ describe('ShowShareModal', () => {
query: { query: 'bye', language: 'kuery' },
} as unknown as DashboardContainerInput;
const showModalProps = getPropsAndShare(unsavedDashboardState);
showModalProps.getDashboardState = () => {
return {
panels: {
panel_1: {
type: 'panel_type',
gridData: { w: 0, h: 0, x: 0, y: 0, i: '0' },
panelRefName: 'superPanel',
explicitInput: {
id: 'superPanel',
},
},
},
} as unknown as DashboardContainerInput;
};
ShowShareModal(showModalProps);
expect(toggleShareMenuSpy).toHaveBeenCalledTimes(1);
const shareLocatorParams = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,9 @@ export function ShowShareModal({
}, {} as DashboardPanelMap)
: {};

// this dashboard has unsaved panels.
//
const allUnsavedPanelsMap = {
...latestPanels,
...(unsavedDashboardState?.panels ?? {}),
...modifiedPanels,
};
return convertPanelMapToSavedPanels(allUnsavedPanelsMap);
Expand Down

0 comments on commit a323be8

Please sign in to comment.