Skip to content

Commit

Permalink
fix: fix ci warning on no key of element list (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
taozhou-glean authored Apr 13, 2023
1 parent 461c79e commit 2cb29a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react/src/Trans.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ describe("Trans component", () => {
const translation = html(
<Trans
id="Hello {name}"
values={{ name: [<strong>John</strong>, <strong>!</strong>] }}
values={{
name: [<strong key="1">John</strong>, <strong key="2">!</strong>],
}}
/>
)
expect(translation).toEqual("Hello <strong>John</strong><strong>!</strong>")
Expand Down Expand Up @@ -158,7 +160,9 @@ describe("Trans component", () => {
<Trans
id="Read <link>the <strong>docs</strong></link>, {name}"
components={{ link: <a href="/docs" />, strong: <strong /> }}
values={{ name: [<strong>John</strong>, <strong>!</strong>] }}
values={{
name: [<strong key="1">John</strong>, <strong key="2">!</strong>],
}}
/>
)
expect(translation).toEqual(
Expand Down

0 comments on commit 2cb29a6

Please sign in to comment.