Skip to content

Commit

Permalink
fix RootContainer test
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirAfanasievFS committed Jan 11, 2021
1 parent 037281b commit f0d00d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion services/app/assets/js/__tests__/RootContainer.test.jsx
Expand Up @@ -71,5 +71,5 @@ test('test rendering active game components', async () => {
render(<Provider store={store}><RootContainer /></Provider>);

expect(screen.getByText(/Online users:/)).toBeInTheDocument();
expect(screen.getByText(/Task/)).toBeInTheDocument();
expect(screen.getByText(/^(Task)$/)).toBeInTheDocument();
});
6 changes: 3 additions & 3 deletions services/app/assets/js/widgets/containers/GameWidget.jsx
Expand Up @@ -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 (
<>
<div className={`flex-grow-1 ${over}`} id="editor">

{showTab === 'editor' ? <div className="h-100">{children}</div>
: (
<div className="h-auto">
<Output sideOutput={output} />
{isShowOutput && <Output sideOutput={output} />}
</div>
)}

Expand Down Expand Up @@ -54,7 +54,7 @@ const RightSide = ({ output, children }) => {
setShowTab('output');
}}
>
<OutputTab sideOutput={output} side="right" />
{isShowOutput && <OutputTab sideOutput={output} side="right" />}
</a>
</div>
</nav>
Expand Down
5 changes: 3 additions & 2 deletions services/app/assets/js/widgets/containers/InfoWidget.jsx
Expand Up @@ -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 (
<>
Expand Down Expand Up @@ -39,7 +40,7 @@ const InfoWidget = () => {
aria-controls={`${idOutput}`}
aria-selected="false"
>
<OutputTab sideOutput={leftOutput} side="left" />
{isShowOutput && <OutputTab sideOutput={leftOutput} side="left" />}
</a>
</div>
</nav>
Expand All @@ -63,7 +64,7 @@ const InfoWidget = () => {
role="tabpanel"
aria-labelledby={`${idOutput}-tab`}
>
<Output sideOutput={leftOutput} />
{isShowOutput && <Output sideOutput={leftOutput} />}
</div>

</div>
Expand Down

0 comments on commit f0d00d0

Please sign in to comment.