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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user