2020-05-20 16:33:40 +00:00
|
|
|
const data = require('../../data');
|
2021-07-02 17:39:39 +00:00
|
|
|
const {
|
|
|
|
navigateToLogin, login, tapBack, sleep, searchRoom
|
|
|
|
} = require('../../helpers/app');
|
2020-07-22 16:32:21 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const privateRoomName = data.groups.private.name;
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2018-07-10 13:40:32 +00:00
|
|
|
async function navigateToRoomInfo(type) {
|
|
|
|
let room;
|
|
|
|
if (type === 'd') {
|
|
|
|
room = 'rocket.cat';
|
|
|
|
} else {
|
2020-07-22 16:32:21 +00:00
|
|
|
room = privateRoomName;
|
2018-07-10 13:40:32 +00:00
|
|
|
}
|
2020-07-06 20:56:28 +00:00
|
|
|
await searchRoom(room);
|
2021-01-20 19:53:12 +00:00
|
|
|
await element(by.id(`rooms-list-view-item-${ room }`)).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toExist().withTimeout(2000);
|
2021-04-07 18:31:25 +00:00
|
|
|
await element(by.id('room-header')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
|
2018-07-10 13:40:32 +00:00
|
|
|
await element(by.id('room-actions-info')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
async function waitForToast() {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('toast'))).toExist().withTimeout(10000);
|
|
|
|
// await expect(element(by.id('toast'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// await waitFor(element(by.id('toast'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
// await expect(element(by.id('toast'))).toBeNotVisible();
|
2020-09-11 14:31:38 +00:00
|
|
|
await sleep(300);
|
2020-03-03 20:27:38 +00:00
|
|
|
}
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
describe('Room info screen', () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
before(async() => {
|
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(data.users.regular.username, data.users.regular.password);
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Direct', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
before(async() => {
|
2018-07-10 13:40:32 +00:00
|
|
|
await navigateToRoomInfo('d');
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to room info', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-view'))).toExist();
|
|
|
|
await expect(element(by.id('room-info-view-name'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2020-07-22 16:32:21 +00:00
|
|
|
|
|
|
|
after(async() => {
|
2021-07-02 17:39:39 +00:00
|
|
|
await tapBack();
|
|
|
|
await tapBack();
|
|
|
|
await tapBack();
|
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Channel/Group', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
before(async() => {
|
2018-07-10 13:40:32 +00:00
|
|
|
await navigateToRoomInfo('c');
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Render', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have room info view', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have name', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-view-name'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have description', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.label('Description'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have topic', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.label('Topic'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have announcement', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.label('Announcement'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have edit button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-view-edit-button'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Render Edit', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
before(async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view-edit-button'))).toExist().withTimeout(10000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-view-edit-button')).tap();
|
2020-05-20 16:33:40 +00:00
|
|
|
await waitFor(element(by.id('room-info-edit-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have room info edit view', async() => {
|
|
|
|
await expect(element(by.id('room-info-edit-view'))).toExist();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have name input', async() => {
|
2018-05-29 17:09:20 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-name'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have description input', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-description'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have topic input', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-topic'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have announcement input', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-announcement'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have password input', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-password'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have type switch', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
// Ugly hack to scroll on detox
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.8);
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-t'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have ready only switch', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-ro'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have submit button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-submit'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have reset button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-reset'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have archive button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-archive'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have delete button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-delete'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
after(async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
// Ugly hack to scroll on detox
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('down', 'fast', 0.8);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
|
|
|
describe('Usage', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
// it('should enter "invalid name" and get error', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
// await element(by.type('UIScrollView')).atIndex(1).swipe('down');
|
2018-05-23 13:39:18 +00:00
|
|
|
// await element(by.id('room-info-edit-view-name')).replaceText('invalid name');
|
2020-03-03 20:27:38 +00:00
|
|
|
// await element(by.type('UIScrollView')).atIndex(1).swipe('up');
|
2018-05-23 13:39:18 +00:00
|
|
|
// await element(by.id('room-info-edit-view-submit')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.text('There was an error while saving settings!'))).toExist().withTimeout(60000);
|
|
|
|
// await expect(element(by.text('There was an error while saving settings!'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
// await element(by.text('OK')).tap();
|
|
|
|
// await waitFor(element(by.text('There was an error while saving settings!'))).toBeNotVisible().withTimeout(10000);
|
2020-03-03 20:27:38 +00:00
|
|
|
// await element(by.type('UIScrollView')).atIndex(1).swipe('down');
|
2018-05-23 13:39:18 +00:00
|
|
|
// });
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should change room name', async() => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await element(by.id('room-info-edit-view-name')).replaceText(`${ privateRoomName }new`);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-10-30 17:35:07 +00:00
|
|
|
await waitForToast();
|
2018-08-31 18:13:30 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view'))).toExist().withTimeout(2000);
|
2020-07-22 16:32:21 +00:00
|
|
|
await expect(element(by.id('room-info-view-name'))).toHaveLabel(`${ privateRoomName }new`);
|
2018-05-23 13:39:18 +00:00
|
|
|
// change name to original
|
|
|
|
await element(by.id('room-info-view-edit-button')).tap();
|
2020-05-20 16:33:40 +00:00
|
|
|
await waitFor(element(by.id('room-info-edit-view'))).toExist().withTimeout(2000);
|
2020-07-22 16:32:21 +00:00
|
|
|
await element(by.id('room-info-edit-view-name')).replaceText(`${ privateRoomName }`);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('down', 'fast', 0.8);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should reset form', async() => {
|
|
|
|
await element(by.id('room-info-edit-view-name')).replaceText('abc');
|
|
|
|
await element(by.id('room-info-edit-view-description')).replaceText('abc');
|
|
|
|
await element(by.id('room-info-edit-view-topic')).replaceText('abc');
|
|
|
|
await element(by.id('room-info-edit-view-announcement')).replaceText('abc');
|
|
|
|
await element(by.id('room-info-edit-view-password')).replaceText('abc');
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.3);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-t')).tap();
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('room-info-edit-view-ro')).longPress(); // https://github.com/facebook/react-native/issues/28032
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-react-when-ro')).tap();
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.2);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-reset')).tap();
|
|
|
|
// after reset
|
2020-07-22 16:32:21 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-name'))).toHaveText(privateRoomName);
|
2018-05-23 13:39:18 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-description'))).toHaveText('');
|
|
|
|
await expect(element(by.id('room-info-edit-view-topic'))).toHaveText('');
|
|
|
|
await expect(element(by.id('room-info-edit-view-announcement'))).toHaveText('');
|
|
|
|
await expect(element(by.id('room-info-edit-view-password'))).toHaveText('');
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('down', 'fast', 0.2);
|
|
|
|
await expect(element(by.id('room-info-edit-view-t'))).toHaveToggleValue(true);
|
|
|
|
await expect(element(by.id('room-info-edit-view-ro'))).toHaveToggleValue(false);
|
2018-05-23 13:39:18 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-react-when-ro'))).toBeNotVisible();
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('down', 'fast', 0.8);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should change room description', async() => {
|
|
|
|
await element(by.id('room-info-edit-view-description')).replaceText('new description');
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2018-08-31 18:13:30 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view'))).toExist().withTimeout(2000);
|
2021-06-15 10:19:11 +00:00
|
|
|
await expect(element(by.text('new description').withAncestor(by.id('room-info-view-description')))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should change room topic', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view-edit-button'))).toExist().withTimeout(10000);
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('room-info-view-edit-button')).tap();
|
|
|
|
await waitFor(element(by.id('room-info-edit-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-topic')).replaceText('new topic');
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2018-08-31 18:13:30 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view'))).toExist().withTimeout(2000);
|
2021-06-15 10:19:11 +00:00
|
|
|
await expect(element(by.text('new topic').withAncestor(by.id('room-info-view-topic')))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should change room announcement', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view-edit-button'))).toExist().withTimeout(10000);
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('room-info-view-edit-button')).tap();
|
|
|
|
await waitFor(element(by.id('room-info-edit-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-announcement')).replaceText('new announcement');
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2018-08-31 18:13:30 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view'))).toExist().withTimeout(2000);
|
2021-06-15 10:19:11 +00:00
|
|
|
await expect(element(by.text('new announcement').withAncestor(by.id('room-info-view-announcement')))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should change room password', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-view-edit-button'))).toExist().withTimeout(10000);
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('room-info-view-edit-button')).tap();
|
|
|
|
await waitFor(element(by.id('room-info-edit-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-password')).replaceText('password');
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should change room type', async() => {
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('down', 'fast', 0.3);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-t')).tap();
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.2);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('down', 'fast', 0.2);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-t')).tap();
|
2021-06-15 10:19:11 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.2);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-submit')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitForToast();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should change room read only and allow reactions', async() => {
|
|
|
|
// await sleep(1000);
|
|
|
|
// await element(by.type('UIScrollView')).atIndex(1).swipe('up');
|
|
|
|
// await element(by.id('room-info-edit-view-ro')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('room-info-edit-view-react-when-ro'))).toExist().withTimeout(2000);
|
|
|
|
// await expect(element(by.id('room-info-edit-view-react-when-ro'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// await element(by.id('room-info-edit-view-react-when-ro')).tap();
|
|
|
|
// await element(by.id('room-info-edit-view-submit')).tap();
|
|
|
|
// await waitForToast();
|
|
|
|
// // TODO: test if it's possible to react
|
|
|
|
// });
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should archive room', async() => {
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-archive')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Yes, archive it!'))).toExist().withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Yes, archive it!')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-info-edit-view-unarchive'))).toExist().withTimeout(60000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await expect(element(by.id('room-info-edit-view-archive'))).toBeNotVisible();
|
2018-05-23 13:39:18 +00:00
|
|
|
// TODO: needs permission to unarchive
|
|
|
|
// await element(by.id('room-info-edit-view-archive')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.text('Yes, unarchive it!'))).toExist().withTimeout(5000);
|
|
|
|
// await expect(element(by.text('Yes, unarchive it!'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
// await element(by.text('Yes, unarchive it!')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.text('ARCHIVE'))).toExist().withTimeout(60000);
|
|
|
|
// await expect(element(by.text('ARCHIVE'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should delete room', async() => {
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-info-edit-view-delete')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Yes, delete it!'))).toExist().withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Yes, delete it!')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(10000);
|
2020-07-22 16:32:21 +00:00
|
|
|
await waitFor(element(by.id(`rooms-list-view-item-${ privateRoomName }`))).toBeNotVisible().withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|