Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
core
/
internationalization
/
File Content:
index.test.tsx
import { render } from '@testing-library/react'; import React from 'react'; import { Trans } from './index'; describe('internationalization', () => { describe('Trans component', () => { it('should interpolate strings without escaping dangerous characters', () => { const name = '<script></script>'; const { getByText } = render(<Trans i18nKey="explore.table.title-with-name">Table - {{ name }}</Trans>); expect(getByText('Table - <script></script>')).toBeInTheDocument(); }); it('should escape dangerous characters when shouldUnescape is false', () => { const name = '<script></script>'; const { getByText } = render( <Trans i18nKey="explore.table.title-with-name" shouldUnescape={false}> Table - {{ name }} </Trans> ); expect(getByText('Table - <script></script>')).toBeInTheDocument(); }); }); });
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
constants.test.ts
465 bytes
0644
constants.ts
1576 bytes
0644
index.test.tsx
910 bytes
0644
index.tsx
2936 bytes
0644
N4ST4R_ID | Naxtarrr