diff --git a/app/screens/edit_post/__snapshots__/edit_post.test.js.snap b/app/screens/edit_post/__snapshots__/edit_post.test.js.snap index 513db88fc..943e3f2dc 100644 --- a/app/screens/edit_post/__snapshots__/edit_post.test.js.snap +++ b/app/screens/edit_post/__snapshots__/edit_post.test.js.snap @@ -65,7 +65,7 @@ exports[`EditPost should match snapshot 1`] = ` }, ] } - testID="edit_post.input" + testID="edit_post.message.input" underlineColorAndroid="transparent" /> diff --git a/app/screens/edit_post/edit_post.js b/app/screens/edit_post/edit_post.js index b3a151692..ab55d1db4 100644 --- a/app/screens/edit_post/edit_post.js +++ b/app/screens/edit_post/edit_post.js @@ -47,12 +47,13 @@ export default class EditPost extends PureComponent { leftButton = { id: 'close-edit-post', - testID: 'edit_post.close', + testID: 'close.edit_post.button', }; rightButton = { id: 'edit-post', showAsAction: 'always', + testID: 'edit_post.save.button', }; constructor(props, context) { @@ -266,7 +267,7 @@ export default class EditPost extends PureComponent { {displayError} { if (isAndroid()) { diff --git a/detox/e2e/test/autocomplete/edit_post.e2e.js b/detox/e2e/test/autocomplete/edit_post.e2e.js index 8bd4adca5..27ba68832 100644 --- a/detox/e2e/test/autocomplete/edit_post.e2e.js +++ b/detox/e2e/test/autocomplete/edit_post.e2e.js @@ -50,16 +50,19 @@ describe('Autocomplete', () => { await EditPostScreen.open(); const {atMentionSuggestionList} = Autocomplete; - const {editPostInput, editPostClose} = EditPostScreen; + const { + closeEditPostButton, + messageInput, + } = EditPostScreen; // # Open autocomplete await expect(atMentionSuggestionList).not.toExist(); - await editPostInput.typeText(' @'); + await messageInput.typeText(' @'); // * Expect at_mention autocomplete to render await expect(atMentionSuggestionList).toExist(); // # Close edit post screen - await editPostClose.tap(); + await closeEditPostButton.tap(); }); }); diff --git a/detox/e2e/test/smoke_test/logout.e2e.js b/detox/e2e/test/smoke_test/logout.e2e.js new file mode 100644 index 000000000..50eb88be1 --- /dev/null +++ b/detox/e2e/test/smoke_test/logout.e2e.js @@ -0,0 +1,30 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +// ******************************************************************* +// - [#] indicates a test step (e.g. # Go to a screen) +// - [*] indicates an assertion (e.g. * Check the title) +// - Use element testID when selecting an element. Create one if none. +// ******************************************************************* + +import {SettingsSidebar} from '@support/ui/component'; +import { + ChannelScreen, + SelectServerScreen, +} from '@support/ui/screen'; +import {Setup} from '@support/server_api'; + +describe('Logout', () => { + beforeAll(async () => { + const {user} = await Setup.apiInit(); + + // # Open channel screen + await ChannelScreen.open(user); + }); + + it('MM-T3273 should be able to log out', async () => { + await ChannelScreen.openSettingsSidebar(); + await SettingsSidebar.tapLogoutAction(); + await SelectServerScreen.toBeVisible(); + }); +}); diff --git a/detox/e2e/test/smoke_test/message_edit.e2e.js b/detox/e2e/test/smoke_test/message_edit.e2e.js new file mode 100644 index 000000000..6e1997d21 --- /dev/null +++ b/detox/e2e/test/smoke_test/message_edit.e2e.js @@ -0,0 +1,66 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +// ******************************************************************* +// - [#] indicates a test step (e.g. # Go to a screen) +// - [*] indicates an assertion (e.g. * Check the title) +// - Use element testID when selecting an element. Create one if none. +// ******************************************************************* + +import { + ChannelScreen, + EditPostScreen, +} from '@support/ui/screen'; +import { + Channel, + Post, + Setup, +} from '@support/server_api'; + +describe('Message Edit', () => { + let testChannel; + + beforeAll(async () => { + const {team, user} = await Setup.apiInit(); + const {channel} = await Channel.apiGetChannelByName(team.name, 'town-square'); + testChannel = channel; + + // # Open channel screen + await ChannelScreen.open(user); + }); + + afterAll(async () => { + await ChannelScreen.logout(); + }); + + it('MM-T3228 should be able to edit a message and save', async () => { + const { + getPostListPostItem, + openPostOptionsFor, + postMessage, + } = ChannelScreen; + const { + messageInput, + saveButton, + } = EditPostScreen; + + // # Post a message + const testMessage = Date.now().toString(); + await postMessage(testMessage); + + // # Open edit post screen + const {post} = await Post.apiGetLastPostInChannel(testChannel.id); + await openPostOptionsFor(post.id, testMessage); + await EditPostScreen.open(); + + // # Edit post and save + const additionalText = ' additional text'; + await messageInput.typeText(additionalText); + await saveButton.tap(); + + // * Verify post is edited + await ChannelScreen.toBeVisible(); + const {postListPostItem} = await getPostListPostItem(post.id, `${testMessage}${additionalText} (edited)`); + await expect(postListPostItem).toBeVisible(); + }); +});