-
-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy path017-keyboard-chat-scroll-view.e2e.ts
More file actions
61 lines (52 loc) · 2.32 KB
/
017-keyboard-chat-scroll-view.e2e.ts
File metadata and controls
61 lines (52 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { expect } from "detox";
import { expectBitmapsToBeEqual } from "./asserts";
import {
scrollDownUntilElementIsVisible,
waitAndTap,
waitForElementById,
waitForExpect,
} from "./helpers";
describe("`KeyboardChatScrollView` specs", () => {
it("should navigate to `KeyboardChatScrollView` example", async () => {
await scrollDownUntilElementIsVisible("main_scroll_view", "chat_kit");
await waitAndTap("chat_kit");
await waitForElementById("chat.input");
await expect(element(by.id("layout_passes"))).toHaveText("Layout pass: 2");
});
it("should use non-inverted `FlatList`", async () => {
await waitAndTap("open_bottom_sheet_modal");
await waitAndTap("bottom_sheet_toggle_flat_list_state");
await waitAndTap("bottom_sheet_close_modal");
await element(by.id("chat.scroll")).swipe("up", "fast", 1, 0.5, 0.5);
// component gets re-mounted
await expect(element(by.id("layout_passes"))).toHaveText("Layout pass: 1");
});
it("should push content up with `always` mode", async () => {
await waitAndTap("chat.input");
await waitForExpect(async () => {
await expectBitmapsToBeEqual("KeyboardChatScrollViewAlways");
});
await expect(element(by.id("layout_passes"))).toHaveText("Layout pass: 1");
});
it("should push content down even if you scrolled a little bit", async () => {
await element(by.id("chat.scroll")).swipe("down", "slow", 0.1, 0.5, 0.3);
await waitAndTap("layout_passes");
await waitForExpect(async () => {
await expectBitmapsToBeEqual("KeyboardChatScrollViewAlwaysClosed");
});
await expect(element(by.id("layout_passes"))).toHaveText("Layout pass: 1");
});
it("should not change position if we reached the top", async () => {
await element(by.id("chat.scroll")).swipe("down", "fast", 1, 0.5, 0.5);
await waitAndTap("chat.input");
await element(by.id("chat.scroll")).swipe("down", "fast", 0.25, 0.5, 0.2);
await expect(element(by.id("layout_passes"))).toHaveText("Layout pass: 1");
await waitAndTap("layout_passes");
await waitForExpect(async () => {
await expectBitmapsToBeEqual("KeyboardChatScrollViewAlwaysClosedAtTop");
});
});
it("should change content position when input grows", () => {});
it("should work with inverted list", () => {});
it("should close keyboard interactively", () => {});
});