Update useResourceStats hook in BootstrapStep component to accept selected target

- Modified the BootstrapStep component to pass the selected target to the useResourceStats hook.
- Updated related tests to reflect the change in expected arguments for the useResourceStats hook.
This commit is contained in:
Roberto Jimenez Sanchez
2025-12-10 17:04:28 +01:00
parent b4faf08646
commit 746d7454d2
2 changed files with 3 additions and 3 deletions
@@ -207,7 +207,7 @@ describe('BootstrapStep', () => {
setup();
const mockUseResourceStats = require('./hooks/useResourceStats').useResourceStats;
expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', undefined);
expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', 'instance');
});
it('should use useResourceStats hook with legacy storage flag', async () => {
@@ -220,7 +220,7 @@ describe('BootstrapStep', () => {
});
const mockUseResourceStats = require('./hooks/useResourceStats').useResourceStats;
expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', true);
expect(mockUseResourceStats).toHaveBeenCalledWith('test-repo', 'instance');
});
});
@@ -37,7 +37,7 @@ export const BootstrapStep = memo(function BootstrapStep({ settingsData, repoNam
const repositoryType = watch('repository.type');
const { enabledOptions, disabledOptions } = useModeOptions(repoName, settingsData);
const { target } = enabledOptions?.[0];
const { resourceCountString, fileCountString, isLoading } = useResourceStats(repoName);
const { resourceCountString, fileCountString, isLoading } = useResourceStats(repoName, selectedTarget);
const styles = useStyles2(getStyles);
useEffect(() => {