import React from 'react'; import { render } from '@testing-library/react'; import ChatBubble from './ChatBubble'; import { memori, tenant, sessionID } from '../../mocks/data'; it('renders ChatBubble unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with initial msg unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with user msg unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('shows copy button for user messages', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with copy disabled unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with msg generated by AI unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with translation and original unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with msg from BoE expert unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with debug button unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble from user with avatar unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble from user with custom avatar unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble from user with avatar as react element unchanged', () => { const { container } = render( USER} message={{ fromUser: true, text: 'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.', initial: false, translatedText: 'Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.', }} /> ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with output code unchanged', () => { const { container } = render( { "data": [ 0, 1, 2 ] }', initial: false, }} /> ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with reasoning unchanged', () => { const { container } = render( Lorem ipsum is a dummy or placeholder text commonly used in graphic design, publishing, and web development. Its purpose is to permit a page layout to be designed, independently of the copy that will subsequently populate it, or to demonstrate various fonts of a typeface without meaningful text that could be distracting. More at WikipediaDicta sequi dignissimos quis earum. Quis vel sint voluptas eos ex assumenda. Similique sed modi deleniti et ut quas cumque. Quaerat quis labore ut asperiores aliquid. Voluptatem similique nostrum neque culpa. Ex et iste voluptas est itaque aut aliquam. Qui error perspiciatis aut fuga maiores sint aut aspernatur. Veritatis ipsam iure voluptas asperiores consequuntur unde consequatur vitae. Sequi doloremque inventore reiciendis doloremque voluptates. Quidem repellendus id maxime. Fuga autem quam reiciendis provident in ad. Quia ut nihil voluptate voluptas ipsa porro. Magnam assumenda earum ipsam quisquam aut perspiciatis officiis. Et totam deleniti sed quisquam repellat. Ducimus nostrum voluptatem deleniti sed. Et accusamus temporibus occaecati. Est explicabo vel eum animi deleniti. Qui vel totam est officiis ducimus eligendi iure. Impedit eum ipsa omnis qui dolorem nobis at inventore. Aliquid aliquam esse neque ut vel magni accusamus. Et quia quas consectetur. Dolor dolorum sunt aut enim et quam ut expedita. Quia ut odio totam mollitia. Qui tempore quia quaerat quis enim. Numquam quasi maiores ipsa qui illo. Ea iste iure in corporis non nihil molestias quisquam. Sed suscipit esse dolorem omnis dolore aut. Enim eos id eligendi doloremque.\nProin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.', initial: false, }} /> ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with reasoning shown unchanged', () => { const { container } = render( Lorem ipsum is a dummy or placeholder text commonly used in graphic design, publishing, and web development. Its purpose is to permit a page layout to be designed, independently of the copy that will subsequently populate it, or to demonstrate various fonts of a typeface without meaningful text that could be distracting. More at WikipediaDicta sequi dignissimos quis earum. Quis vel sint voluptas eos ex assumenda. Similique sed modi deleniti et ut quas cumque. Quaerat quis labore ut asperiores aliquid. Voluptatem similique nostrum neque culpa. Ex et iste voluptas est itaque aut aliquam. Qui error perspiciatis aut fuga maiores sint aut aspernatur. Veritatis ipsam iure voluptas asperiores consequuntur unde consequatur vitae. Sequi doloremque inventore reiciendis doloremque voluptates. Quidem repellendus id maxime. Fuga autem quam reiciendis provident in ad. Quia ut nihil voluptate voluptas ipsa porro. Magnam assumenda earum ipsam quisquam aut perspiciatis officiis. Et totam deleniti sed quisquam repellat. Ducimus nostrum voluptatem deleniti sed. Et accusamus temporibus occaecati. Est explicabo vel eum animi deleniti. Qui vel totam est officiis ducimus eligendi iure. Impedit eum ipsa omnis qui dolorem nobis at inventore. Aliquid aliquam esse neque ut vel magni accusamus. Et quia quas consectetur. Dolor dolorum sunt aut enim et quam ut expedita. Quia ut odio totam mollitia. Qui tempore quia quaerat quis enim. Numquam quasi maiores ipsa qui illo. Ea iste iure in corporis non nihil molestias quisquam. Sed suscipit esse dolorem omnis dolore aut. Enim eos id eligendi doloremque.\nProin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.', initial: false, }} /> ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with markdown unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with markdown and breakline unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with markdown code unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with markdown table unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with complex markdown and math but disabled unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with complex markdown and math 1 unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with complex markdown and math 2 unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with complex markdown and math 3 unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with complex markdown and math 4 unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with complex markdown and math 5 unchanged', () => { const { container } = render( ); expect(container).toMatchSnapshot(); }); it('renders ChatBubble with reasoning and output and markdown unchanged', () => { const { container } = render( L\'utente vuole che io elenchi i parametri dell\'ALBERO ESISTENTE. Devo fare una Rails Query per recuperare tutti i parametri specifici di questo oggetto dal project snapshot.\n\n\n\nRecupero tutti i 7 parametri dell\'ALBERO ESISTENTE...', }} /> ); expect(container).toMatchSnapshot(); });