import * as React from 'react'; import expect from 'expect'; import { render, waitFor } from '@testing-library/react'; import { Basic } from './RichTextInput.stories'; describe('', () => { it('should update its content when fields value changes', async () => { const record = { id: 123, body: '

Hello world!

' }; const { container, rerender } = render(); await waitFor(() => { expect(container.querySelector('.ProseMirror')?.innerHTML).toEqual( '

Hello world!

' ); }); const newRecord = { id: 123, body: '

Goodbye world!

' }; rerender(); await waitFor(() => { expect(container.querySelector('.ProseMirror')?.innerHTML).toEqual( '

Goodbye world!

' ); }); }); });