forked from wswebcreation/wswebcreation-react-native-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchats.spec.js
27 lines (24 loc) · 1.12 KB
/
chats.spec.js
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
import { screens } from '../screen-objects/base';
import { addChat, getChatBubble, selectFirstChat } from '../screen-objects/chats';
import { selectScreenFromTabBar } from '../screen-objects/navigation';
import { SCREENS, TABBAR } from '../support/constants';
describe('Use the Chats', () => {
beforeEach(async () => {
await device.reloadReactNative();
await selectScreenFromTabBar(TABBAR.CHATS);
await expect(screens(SCREENS.CHATS)).toBeVisible();
await selectFirstChat();
});
it('should validate the default chats', async () => {
await expect(getChatBubble(0)).toHaveLabel('Hey wassup?');
await expect(getChatBubble(1)).toHaveLabel('So it seems like this internet thing is here to stay, huh?');
});
it('should able to chat and get a random response back', async () => {
const chat = 'Hello';
await addChat(chat);
await expect(getChatBubble(0)).toHaveLabel('Hey wassup?');
await expect(getChatBubble(1)).toHaveLabel('So it seems like this internet thing is here to stay, huh?');
await expect(getChatBubble(2)).toHaveLabel(chat);
await expect(getChatBubble(3)).toBeVisible();
});
});