MM-63411 Don't focus thread textbox automatically when it has a draft (#31250)

* MM-63411 Don't focus thread textbox automatically when it has a draft

* Add E2E test

* Add test files forgotten in previous commit

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Harrison Healey
2025-06-04 16:08:33 -04:00
коммит произвёл GitHub
родитель a19eb5b9ef
Коммит 6517fa2fd1
7 изменённых файлов: 175 добавлений и 2 удалений

Просмотреть файл

@@ -34,10 +34,11 @@ export class TestBrowser {
const systemConsolePage = new pages.SystemConsolePage(page);
const scheduledPostsPage = new pages.ScheduledPostsPage(page);
const draftsPage = new pages.DraftsPage(page);
const threadsPage = new pages.ThreadsPage(page);
this.context = context;
return {context, page, channelsPage, systemConsolePage, scheduledPostsPage, draftsPage};
return {context, page, channelsPage, systemConsolePage, scheduledPostsPage, draftsPage, threadsPage};
}
async close() {

Просмотреть файл

@@ -9,6 +9,7 @@ import SignupPage from './signup';
import SystemConsolePage from './system_console';
import ScheduledPostsPage from './scheduled_posts';
import DraftsPage from './drafts';
import ThreadsPage from './threads';
const pages = {
ChannelsPage,
@@ -19,6 +20,7 @@ const pages = {
ScheduledPostsPage,
SystemConsolePage,
DraftsPage,
ThreadsPage,
};
export {

Просмотреть файл

@@ -0,0 +1,46 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Page, expect} from '@playwright/test';
import {ChannelsPost} from '@/ui/components';
export default class ThreadsPage {
readonly page: Page;
readonly threadsList;
readonly noThreadSelected;
constructor(page: Page) {
this.page = page;
this.threadsList = page.locator('#threads-list');
this.noThreadSelected = page.locator('.no-results__title', {
hasText: /Looks like youre all caught up|Catch up on your threads/,
});
}
async goto(teamName: string) {
await this.page.goto(`/${teamName}/threads`);
}
async toBeVisible() {
await expect(this.threadsList).toBeVisible();
}
async toHaveThreadSelected() {
await expect(this.noThreadSelected).not.toBeAttached();
}
async toNotHaveThreadSelected() {
await expect(this.noThreadSelected).toBeVisible();
}
async getLastPost() {
const lastPost = this.page.getByTestId('rhsPostView').last();
await lastPost.waitFor();
return new ChannelsPost(lastPost);
}
}