mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
* Fix/removed forwarding Signed-off-by: Levi Harrison <git@leviharrison.dev> * Added global 'wasReady' and 'wasUnexpected' Signed-off-by: Levi Harrison <git@leviharrison.dev> * Eslint fixes Signed-off-by: Levi Harrison <git@leviharrison.dev> * Added withStartingIndicator wrapper Signed-off-by: Levi Harrison <git@leviharrison.dev> * Fixed condition Signed-off-by: Levi Harrison <git@leviharrison.dev> * Removed unused import Signed-off-by: Levi Harrison <git@leviharrison.dev> * Moved withStartingIndicator calls to pages index Signed-off-by: Levi Harrison <git@leviharrison.dev> * Fixed withStartingIndicator tests Signed-off-by: Levi Harrison <git@leviharrison.dev> * Fixed eslint (maybe?) Signed-off-by: Levi Harrison <git@leviharrison.dev> * Trailing comma Signed-off-by: Levi Harrison <git@leviharrison.dev> * Added prettier ignore Signed-off-by: Levi Harrison <git@leviharrison.dev> * Fix eslint (pt. 2) Signed-off-by: Levi Harrison <git@leviharrison.dev>
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import * as React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { WALReplayData } from '../types/types';
|
|
import { StartingContent } from './withStartingIndicator';
|
|
import { Progress } from 'reactstrap';
|
|
|
|
describe('Starting', () => {
|
|
describe('progress bar', () => {
|
|
it('does not show when replay not started', () => {
|
|
const status: WALReplayData = {
|
|
min: 0,
|
|
max: 0,
|
|
current: 0,
|
|
};
|
|
const starting = shallow(<StartingContent status={status} isUnexpected={false} />);
|
|
const progress = starting.find(Progress);
|
|
expect(progress).toHaveLength(0);
|
|
});
|
|
|
|
it('renders progress correctly', () => {
|
|
const status: WALReplayData = {
|
|
min: 0,
|
|
max: 20,
|
|
current: 1,
|
|
};
|
|
const starting = shallow(<StartingContent status={status} isUnexpected={false} />);
|
|
const progress = starting.find(Progress);
|
|
expect(progress.prop('value')).toBe(2);
|
|
expect(progress.prop('min')).toBe(0);
|
|
expect(progress.prop('max')).toBe(21);
|
|
});
|
|
|
|
it('shows done when replay done', () => {
|
|
const status: WALReplayData = {
|
|
min: 0,
|
|
max: 20,
|
|
current: 20,
|
|
};
|
|
const starting = shallow(<StartingContent status={status} isUnexpected={false} />);
|
|
const progress = starting.find(Progress);
|
|
expect(progress.prop('value')).toBe(21);
|
|
expect(progress.prop('color')).toBe('success');
|
|
});
|
|
});
|
|
});
|