Merge pull request #15353 from overleaf/ae-upgrade-react-i18next

Upgrade react-i18next to 13.3.1

GitOrigin-RevId: fb2233742a187f1bf39e83f4e9f7ec3fb2a55b8f
This commit is contained in:
Alf Eaton
2023-10-23 08:03:57 +00:00
committed by Copybot
parent 113f5205c6
commit 10348b4544
3 changed files with 36 additions and 9 deletions
+1 -1
View File
@@ -317,7 +317,7 @@
"react-dom": "^17.0.2",
"react-error-boundary": "^2.3.1",
"react-google-recaptcha": "^3.1.0",
"react-i18next": "^13.3.0",
"react-i18next": "^13.3.1",
"react-linkify": "^1.0.0-alpha",
"react-refresh": "^0.14.0",
"react-resizable-panels": "^0.0.55",
@@ -116,5 +116,32 @@ describe('i18n', function () {
.should('have.length', 1)
.should('have.text', "T&e's<code>t</code>ing")
})
it('does not convert markup in values to components', function () {
const Test = () => {
return (
<div data-testid="container">
<Trans
i18nKey="are_you_still_at"
components={[<b />]} // eslint-disable-line react/jsx-key
values={{
institutionName: "<i>T</i>&<b>e</b>'s<code>t</code>ing",
}}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
/>
</div>
)
}
cy.mount(<Test />)
cy.findByTestId('container')
.should(
'have.text',
"Are you still at <i>T</i>&<b>e</b>'s<code>t</code>ing?"
)
.find('b')
.should('have.length', 1)
.should('have.text', "<i>T</i>&<b>e</b>'s<code>t</code>ing")
})
})
})