|
1 | 1 | import { render } from "@testing-library/react-native"; |
2 | 2 | import React from "react"; |
3 | | -import { View } from "react-native"; |
| 3 | +import { TextInput, View } from "react-native"; |
4 | 4 | import { |
5 | 5 | KeyboardAvoidingView, |
6 | 6 | KeyboardAwareScrollView, |
@@ -68,6 +68,27 @@ function KeyboardToolbarTest() { |
68 | 68 | return <KeyboardToolbar content={content} />; |
69 | 69 | } |
70 | 70 |
|
| 71 | +function KeyboardToolbarCompoundTest() { |
| 72 | + return ( |
| 73 | + <> |
| 74 | + <KeyboardToolbar> |
| 75 | + <KeyboardToolbar.Background> |
| 76 | + <EmptyView /> |
| 77 | + </KeyboardToolbar.Background> |
| 78 | + <KeyboardToolbar.Content> |
| 79 | + <EmptyView /> |
| 80 | + </KeyboardToolbar.Content> |
| 81 | + <KeyboardToolbar.Prev /> |
| 82 | + <KeyboardToolbar.Next /> |
| 83 | + <KeyboardToolbar.Done /> |
| 84 | + </KeyboardToolbar> |
| 85 | + <KeyboardToolbar.Group> |
| 86 | + <TextInput /> |
| 87 | + </KeyboardToolbar.Group> |
| 88 | + </> |
| 89 | + ); |
| 90 | +} |
| 91 | + |
71 | 92 | function OverKeyboardViewTest() { |
72 | 93 | return ( |
73 | 94 | <OverKeyboardView visible={true}> |
@@ -109,6 +130,10 @@ describe("components rendering", () => { |
109 | 130 | expect(render(<KeyboardToolbarTest />)).toMatchSnapshot(); |
110 | 131 | }); |
111 | 132 |
|
| 133 | + it("should render compound `KeyboardToolbar`", () => { |
| 134 | + expect(render(<KeyboardToolbarCompoundTest />)).toMatchSnapshot(); |
| 135 | + }); |
| 136 | + |
112 | 137 | it("should render `OverKeyboardView`", () => { |
113 | 138 | expect(render(<OverKeyboardViewTest />)).toMatchSnapshot(); |
114 | 139 | }); |
|
0 commit comments