import { render } from '@testing-library/react';
import { Trans } from './index';
describe('internationalization', () => {
describe('Trans component', () => {
it('should interpolate strings without escaping dangerous characters', () => {
const name = '';
const { getByText } = render(Table - {{ name }});
expect(getByText('Table - ')).toBeInTheDocument();
});
it('should escape dangerous characters when shouldUnescape is false', () => {
const name = '';
const { getByText } = render(
Table - {{ name }}
);
expect(getByText('Table - <script></script>')).toBeInTheDocument();
});
});
});