|
9 | 9 | Plugin, |
10 | 10 | ContributionRewardExtPlugin, |
11 | 11 | ContributionRewardProposal, |
12 | | - ContributionRewardPluginEntity, |
| 12 | + ContributionRewardExtPluginEntity, |
| 13 | + useContributionRewardExtPlugin, |
13 | 14 | } from "../../src"; |
14 | 15 |
|
15 | 16 | const arcConfig = new ArcConfig("private"); |
@@ -40,6 +41,28 @@ describe("Plugin contribution reward ext component ", () => { |
40 | 41 | `); |
41 | 42 | }); |
42 | 43 |
|
| 44 | + it("Shows name using useContributionRewardExtPlugin", async () => { |
| 45 | + const ContributionRewardExtPluginWithHooks = () => { |
| 46 | + const [contributionRewardPluginData] = useContributionRewardExtPlugin(); |
| 47 | + return <div>{"Plugin name: " + contributionRewardPluginData?.name}</div>; |
| 48 | + }; |
| 49 | + const { container, findByText } = render( |
| 50 | + <Arc config={arcConfig}> |
| 51 | + <ContributionRewardExtPlugin id={pluginId}> |
| 52 | + <ContributionRewardExtPluginWithHooks /> |
| 53 | + </ContributionRewardExtPlugin> |
| 54 | + </Arc> |
| 55 | + ); |
| 56 | + |
| 57 | + const name = await findByText(/Plugin name: ContributionRewardExt/); |
| 58 | + expect(name).toBeInTheDocument(); |
| 59 | + expect(container.firstChild).toMatchInlineSnapshot(` |
| 60 | + <div> |
| 61 | + Plugin name: ContributionRewardExt |
| 62 | + </div> |
| 63 | + `); |
| 64 | + }); |
| 65 | + |
43 | 66 | it("Works with inferred plugin", async () => { |
44 | 67 | const { container } = render( |
45 | 68 | <Arc config={arcConfig}> |
|
0 commit comments