2022-09-12 14:51:33 +00:00
|
|
|
import { expect } from 'detox';
|
|
|
|
|
|
|
|
import { navigateToRegister, navigateToLogin } from '../../helpers/app';
|
2020-05-20 16:33:40 +00:00
|
|
|
|
|
|
|
describe('Legal screen', () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
describe('From Login', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have legal button on login', async () => {
|
|
|
|
await waitFor(element(by.id('login-view-more')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to legal from login', async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await expect(element(by.id('login-view-more'))).toBeVisible();
|
|
|
|
await element(by.id('login-view-more')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('legal-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(4000);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|
|
|
|
|
2020-07-22 16:32:21 +00:00
|
|
|
describe('From Register', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToRegister();
|
|
|
|
});
|
2020-05-20 16:33:40 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have legal button on register', async () => {
|
|
|
|
await waitFor(element(by.id('register-view-more')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to legal from register', async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await expect(element(by.id('register-view-more'))).toBeVisible();
|
|
|
|
await element(by.id('register-view-more')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('legal-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(4000);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have terms of service button', async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await expect(element(by.id('legal-terms-button'))).toBeVisible();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have privacy policy button', async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await expect(element(by.id('legal-privacy-button'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
// We can't simulate how webview behaves, so I had to disable :(
|
2021-07-02 17:39:39 +00:00
|
|
|
/*
|
2020-07-22 16:32:21 +00:00
|
|
|
it('should navigate to terms', async() => {
|
|
|
|
await element(by.id('legal-terms-button')).tap();
|
|
|
|
await waitFor(element(by.id('terms-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
await expect(element(by.id('terms-view'))).toBeVisible();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2020-07-22 16:32:21 +00:00
|
|
|
it('should navigate to privacy', async() => {
|
|
|
|
await tapBack();
|
|
|
|
await element(by.id('legal-privacy-button')).tap();
|
|
|
|
await waitFor(element(by.id('privacy-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
await expect(element(by.id('privacy-view'))).toBeVisible();
|
|
|
|
});
|
|
|
|
*/
|
|
|
|
});
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|