mattermost-mobile/detox/e2e/support/ui/component/image_quick_action.js
Joseph Baylon 48dbb75471
MM-29024 Detox/E2E: Add unit and e2e tests for disabled mobile upload (#4954)
* MM-29024 Detox/E2E: Add unit and e2e tests for disabled mobile upload

* Simplified element call

* Remove extra lines

* Added e2e for mobile upload enabled - quick actions

* Fix upload item snap file

* Added check for license

* Fix lint

* Update function export

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-12 21:29:16 -03:00

25 lines
861 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
class ImageQuickAction {
testID = {
imageQuickAction: 'post_draft.image_quick_action',
imageQuickActionDisabled: 'post_draft.image_quick_action.disabled',
}
imageQuickAction = element(by.id(this.testID.imageQuickAction));
imageQuickActionDisabled = element(by.id(this.testID.imageQuickActionDisabled));
toBeVisible = async (options = {disabled: false}) => {
if (options.disabled) {
await expect(this.imageQuickActionDisabled).toBeVisible();
return this.imageQuickActionDisabled;
}
await expect(this.imageQuickAction).toBeVisible();
return this.imageQuickAction;
}
}
const imageQuickAction = new ImageQuickAction();
export default imageQuickAction;