Add max count to sidebar icons

This commit is contained in:
Chewbacca
2022-11-03 12:13:45 -04:00
parent d0960de07c
commit be136fe6cf
8 changed files with 34 additions and 11 deletions

View File

@@ -27,6 +27,11 @@ describe('shortNumberFormat', () => {
expect(screen.getByTestId('num')).toHaveTextContent('•');
});
test('handles max argument', () => {
render(<div data-testid='num'>{shortNumberFormat(25, 20)}</div>, undefined, null);
expect(screen.getByTestId('num')).toHaveTextContent('20+');
});
test('formats numbers under 1,000', () => {
render(<div data-testid='num'>{shortNumberFormat(555)}</div>, undefined, null);
expect(screen.getByTestId('num')).toHaveTextContent('555');