Change starting show screen progress bar condition (#8946)

* Show progress bar when max is not 0

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added semicolon

Signed-off-by: Levi Harrison <git@leviharrison.dev>
This commit is contained in:
Levi Harrison 2021-06-17 06:48:38 -04:00 committed by GitHub
parent a0bac4b488
commit 922f9babb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -17,6 +17,17 @@ describe('Starting', () => {
expect(progress).toHaveLength(0);
});
it('shows progress bar when max is not 0', () => {
const status: WALReplayData = {
min: 0,
max: 1,
current: 0,
};
const starting = shallow(<StartingContent status={status} isUnexpected={false} />);
const progress = starting.find(Progress);
expect(progress).toHaveLength(1);
});
it('renders progress correctly', () => {
const status: WALReplayData = {
min: 0,

View file

@ -23,7 +23,7 @@ export const StartingContent: FC<StartingContentProps> = ({ status, isUnexpected
<div className="text-center m-3">
<div className="m-4">
<h2>Starting up...</h2>
{status?.current! > status?.min! ? (
{status?.max! > 0 ? (
<div>
<p>
Replaying WAL ({status?.current}/{status?.max})