12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import {mountWithTheme} from 'sentry-test/enzyme';
- import ScoreBar from 'sentry/components/scoreBar';
- import UserMisery from 'sentry/components/userMisery';
- describe('UserMisery', function () {
- beforeEach(function () {});
- afterEach(function () {});
- it('renders no bars when user misery is less than 0.05', function () {
- const wrapper = mountWithTheme(
- <UserMisery
- bars={10}
- barHeight={20}
- userMisery={0.04}
- miseryLimit={300}
- miserableUsers={0}
- totalUsers={100}
- />
- );
- expect(wrapper.find(ScoreBar).props().score).toEqual(0);
- });
- it('renders no bars when user misery is equal to 0.05', function () {
- const wrapper = mountWithTheme(
- <UserMisery
- bars={10}
- barHeight={20}
- userMisery={0.05}
- miseryLimit={300}
- miserableUsers={1}
- totalUsers={100}
- />
- );
- expect(wrapper.find(ScoreBar).props().score).toEqual(0);
- });
- it('renders one bar when user misery is greater than 0.05', function () {
- const wrapper = mountWithTheme(
- <UserMisery
- bars={10}
- barHeight={20}
- userMisery={0.06}
- miseryLimit={300}
- miserableUsers={1}
- totalUsers={100}
- />
- );
- expect(wrapper.find(ScoreBar).props().score).toEqual(1);
- });
- });
|