|
| 1 | +import { renderWithAppContext } from '../../__helpers__/test-utils'; |
| 2 | + |
| 3 | +import { NotificationTitle } from './NotificationTitle'; |
| 4 | + |
| 5 | +describe('renderer/components/notifications/NotificationTitle.tsx', () => { |
| 6 | + it('should render plain text without code blocks', () => { |
| 7 | + const tree = renderWithAppContext( |
| 8 | + <NotificationTitle title="Simple notification title" />, |
| 9 | + ); |
| 10 | + |
| 11 | + expect(tree).toMatchSnapshot(); |
| 12 | + }); |
| 13 | + |
| 14 | + it('should render text with single inline code block', () => { |
| 15 | + const tree = renderWithAppContext( |
| 16 | + <NotificationTitle title="refactor: migrate deprecated atlaskit `xcss`" />, |
| 17 | + ); |
| 18 | + |
| 19 | + expect(tree).toMatchSnapshot(); |
| 20 | + }); |
| 21 | + |
| 22 | + it('should render text with multiple inline code blocks', () => { |
| 23 | + const tree = renderWithAppContext( |
| 24 | + <NotificationTitle title="Replace `foo` with `bar` in config" />, |
| 25 | + ); |
| 26 | + |
| 27 | + expect(tree).toMatchSnapshot(); |
| 28 | + }); |
| 29 | + |
| 30 | + it('should render text with code block at the start', () => { |
| 31 | + const tree = renderWithAppContext( |
| 32 | + <NotificationTitle title="`useState` hook implementation" />, |
| 33 | + ); |
| 34 | + |
| 35 | + expect(tree).toMatchSnapshot(); |
| 36 | + }); |
| 37 | + |
| 38 | + it('should render text with code block at the end', () => { |
| 39 | + const tree = renderWithAppContext( |
| 40 | + <NotificationTitle title="Fix issue with `render`" />, |
| 41 | + ); |
| 42 | + |
| 43 | + expect(tree).toMatchSnapshot(); |
| 44 | + }); |
| 45 | + |
| 46 | + it('should apply custom className', () => { |
| 47 | + const tree = renderWithAppContext( |
| 48 | + <NotificationTitle |
| 49 | + className="truncate" |
| 50 | + title="refactor: migrate deprecated atlaskit `xcss`" |
| 51 | + />, |
| 52 | + ); |
| 53 | + |
| 54 | + expect(tree).toMatchSnapshot(); |
| 55 | + }); |
| 56 | +}); |
0 commit comments