fix: prevent resetting test data until data is loaded

This commit is contained in:
kasia.oczkowska
2024-08-23 13:07:05 +01:00
parent 5af1d94fc0
commit 6552ebcd3c

View File

@@ -62,11 +62,11 @@ function TestSubstep(props) {
React.useEffect( React.useEffect(
function resetTestDataOnSubstepToggle() { function resetTestDataOnSubstepToggle() {
if (!expanded) { if (!expanded && !loading) {
reset(); reset();
} }
}, },
[expanded, reset], [expanded, reset, loading],
); );
const handleSubmit = React.useCallback(async () => { const handleSubmit = React.useCallback(async () => {
@@ -118,7 +118,11 @@ function TestSubstep(props) {
)} )}
{hasNoOutput && ( {hasNoOutput && (
<Alert data-test="flow-test-substep-no-output" severity="warning" sx={{ mb: 1, width: '100%' }}> <Alert
data-test="flow-test-substep-no-output"
severity="warning"
sx={{ mb: 1, width: '100%' }}
>
<AlertTitle sx={{ fontWeight: 700 }}> <AlertTitle sx={{ fontWeight: 700 }}>
{formatMessage('flowEditor.noTestDataTitle')} {formatMessage('flowEditor.noTestDataTitle')}
</AlertTitle> </AlertTitle>