{ const textarea = await canvas.findByRole('textbox'); const submitButton = await canvas.findByRole('button', { name: 'Send' }); // Expect the input to be focused after the component is mounted await expect(textarea).toHaveFocus(); // Expect the submit button to be disabled await expect(submitButton).toBeDisabled(); const text = 'What is the meaning of life?'; await userEvent.clear(textarea); await userEvent.type(textarea, text); await expect(textarea).toHaveValue(text); const fileInput = document.querySelector('input[type="file"]'); await expect(fileInput).not.toHaveAttribute('accept'); }} /> { const jpgAttachment = canvas.getByAltText('1.jpg'); const svgAttachment = canvas.getByAltText('hf-logo.svg'); const pdfFileExtension = canvas.getByText('PDF'); const pdfAttachment = canvas.getByText('example.pdf'); const pdfSize = canvas.getByText('342.82 KB'); await expect(jpgAttachment).toBeInTheDocument(); await expect(jpgAttachment).toHaveAttribute('src', jpgAsset); await expect(svgAttachment).toBeInTheDocument(); await expect(svgAttachment).toHaveAttribute('src', svgAsset); await expect(pdfFileExtension).toBeInTheDocument(); await expect(pdfAttachment).toBeInTheDocument(); await expect(pdfSize).toBeInTheDocument(); }} />