mattermost-mobile/detox/e2e/support/ui/screen/create_channel.js
Elias Nahum 5ea470a235
V1 dependencies and bump to RN 0.67.2 (#5908)
* update dependencies

* eslint fixes

* Upgrade to RN 67

* update other deps

* Update to RN 0.67.2

* fix Android build (mmkv)

* Fix crash when root message is deleted from the thread screen

* Fix gif emoji playing at high speed on iOS ProMotion capable devices
2022-02-02 15:28:57 -03:00

49 lines
1.5 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {
BottomSheet,
EditChannelInfo,
MainSidebar,
} from '@support/ui/component';
class CreateChannelScreen {
testID = {
createChannelScreen: 'create_channel.screen',
createButton: 'create_channel.create.button',
backButton: 'screen.back.button',
};
createChannelScreen = element(by.id(this.testID.createChannelScreen));
createButton = element(by.id(this.testID.createButton));
backButton = element(by.id(this.testID.backButton));
// convenience props
publicChannelTypeAction = EditChannelInfo.publicChannelTypeAction;
privateChannelTypeAction = EditChannelInfo.privateChannelTypeAction;
nameInput = EditChannelInfo.nameInput;
purposeInput = EditChannelInfo.purposeInput;
headerInput = EditChannelInfo.headerInput;
toBeVisible = async () => {
await expect(this.createChannelScreen).toBeVisible();
return this.createChannelScreen;
};
open = async () => {
// # Open create channel screen
await MainSidebar.channelsActionButton.tap();
await BottomSheet.createOption.tap();
return this.toBeVisible();
};
back = async () => {
await this.backButton.tap();
await expect(this.createChannelScreen).not.toBeVisible();
};
}
const createChannelScreen = new CreateChannelScreen();
export default createChannelScreen;