Skip to content

Commit

Permalink
hide game for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Dec 16, 2024
1 parent 3cf2792 commit 84bc2ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/pages/BlockCountdown.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('short period until the block +@mobile', async({ render, mockApiResponse })
blockno: height,
},
});
const component = await render(<BlockCountdown/>, { hooksConfig });
const component = await render(<BlockCountdown hideCapybaraRunner/>, { hooksConfig });
await expect(component).toHaveScreenshot();
});

Expand All @@ -52,6 +52,6 @@ test('long period until the block +@mobile', async({ render, mockApiResponse })
blockno: height,
},
});
const component = await render(<BlockCountdown/>, { hooksConfig });
const component = await render(<BlockCountdown hideCapybaraRunner/>, { hooksConfig });
await expect(component).toHaveScreenshot();
});
8 changes: 6 additions & 2 deletions ui/pages/BlockCountdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ import TruncatedValue from 'ui/shared/TruncatedValue';

import CapybaraRunner from '../games/CapybaraRunner';

const BlockCountdown = () => {
type Props = {
hideCapybaraRunner?: boolean;
};

const BlockCountdown = ({ hideCapybaraRunner }: Props) => {
const router = useRouter();
const height = getQueryParamString(router.query.height);
const iconColor = useColorModeValue('gray.300', 'gray.600');
Expand Down Expand Up @@ -114,7 +118,7 @@ const BlockCountdown = () => {
<StatsWidget label="Remaining blocks" value={ data.result.RemainingBlock } icon="apps_slim"/>
<StatsWidget label="Current block" value={ data.result.CurrentBlock } icon="block_slim"/>
</Grid>
<CapybaraRunner/>
{ !hideCapybaraRunner && <CapybaraRunner/> }
</Flex>
</Center>
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 84bc2ad

Please sign in to comment.