diff --git a/services/app/assets/js/__tests__/RootContainer.test.jsx b/services/app/assets/js/__tests__/RootContainer.test.jsx index 6c94a998b..4bb20e615 100644 --- a/services/app/assets/js/__tests__/RootContainer.test.jsx +++ b/services/app/assets/js/__tests__/RootContainer.test.jsx @@ -71,5 +71,5 @@ test('test rendering active game components', async () => { render(); expect(screen.getByText(/Online users:/)).toBeInTheDocument(); - expect(screen.getByText(/Task/)).toBeInTheDocument(); + expect(screen.getByText(/^(Task)$/)).toBeInTheDocument(); }); diff --git a/services/app/assets/js/widgets/containers/GameWidget.jsx b/services/app/assets/js/widgets/containers/GameWidget.jsx index ba3dd6957..efc26ebd6 100644 --- a/services/app/assets/js/widgets/containers/GameWidget.jsx +++ b/services/app/assets/js/widgets/containers/GameWidget.jsx @@ -16,14 +16,14 @@ import Output from '../components/ExecutionOutput/Output'; const RightSide = ({ output, children }) => { const [showTab, setShowTab] = useState('editor'); const over = showTab === 'editor' ? '' : 'overflow-auto'; + const isShowOutput = output && output.status; return ( <>
- {showTab === 'editor' ?
{children}
: (
- + {isShowOutput && }
)} @@ -54,7 +54,7 @@ const RightSide = ({ output, children }) => { setShowTab('output'); }} > - + {isShowOutput && }
diff --git a/services/app/assets/js/widgets/containers/InfoWidget.jsx b/services/app/assets/js/widgets/containers/InfoWidget.jsx index 62155f750..3915a6448 100644 --- a/services/app/assets/js/widgets/containers/InfoWidget.jsx +++ b/services/app/assets/js/widgets/containers/InfoWidget.jsx @@ -12,6 +12,7 @@ const InfoWidget = () => { const timeoutSeconds = useSelector(state => gameStatusSelector(state).timeoutSeconds); const gameStatusName = useSelector(state => gameStatusSelector(state).status); const leftOutput = useSelector(state => leftExecutionOutputSelector(state)); + const isShowOutput = leftOutput && leftOutput.status; const idOutput = 'leftOutput'; return ( <> @@ -39,7 +40,7 @@ const InfoWidget = () => { aria-controls={`${idOutput}`} aria-selected="false" > - + {isShowOutput && } @@ -63,7 +64,7 @@ const InfoWidget = () => { role="tabpanel" aria-labelledby={`${idOutput}-tab`} > - + {isShowOutput && }