[MM-63023] Conditionally make thread item elements focusable based on whether they have an interaction (#30592)

* [MM-63023] Conditionally make thread item elements focusable based on whether they have an interaction

* Fix i18n & PR feedback

* Remove focusability from the text preview div

* Fix tests
Этот коммит содержится в:
Devin Binnie
2025-04-22 15:55:30 -04:00
коммит произвёл GitHub
родитель 018c909e2f
Коммит a36d29b459
9 изменённых файлов: 164 добавлений и 76 удалений

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

@@ -88,7 +88,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * There should be a thread there
cy.get('article.ThreadItem').should('have.have.lengthOf', 1);
cy.get('div.ThreadItem').should('have.have.lengthOf', 1);
});
});
@@ -129,7 +129,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * There should be 2 threads now
cy.get('article.ThreadItem').should('have.have.lengthOf', 2);
cy.get('div.ThreadItem').should('have.have.lengthOf', 2);
});
});

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

@@ -132,7 +132,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1);
cy.get('div.ThreadItem').should('have.lengthOf', 1);
// # Delete thread root post
cy.apiDeletePost(rootPost.id);
@@ -141,13 +141,13 @@ describe('Collapsed Reply Threads', () => {
* TODO: this should not be there once the root post is deleted, so remove it once the feature is adjusted
*/
// * There should be a single thread item showing '(message deleted)'
cy.get('article.ThreadItem').should('have.lengthOf', 1).should('contain.text', '(message deleted)');
cy.get('div.ThreadItem').should('have.lengthOf', 1).should('contain.text', '(message deleted)');
// # Refresh the page
cy.reload(true);
// * There should be no thread item anymore
cy.get('article.ThreadItem').should('have.lengthOf', 0);
cy.get('div.ThreadItem').should('have.lengthOf', 0);
});
it('MM-T4446 CRT - Delete single reply post on a thread', () => {
@@ -171,7 +171,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).first().click();
cy.get('div.ThreadItem').should('have.lengthOf', 1).first().click();
// * Reply should be in RHS
cy.get(`#rhsPostMessageText_${replyPost1.id}`).should('be.visible').should('contain.text', messages.REPLY1);
@@ -180,7 +180,7 @@ describe('Collapsed Reply Threads', () => {
cy.apiDeletePost(replyPost1.id);
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1);
cy.get('div.ThreadItem').should('have.lengthOf', 1);
// * The reply should be in RHS showing '(message deleted)'
cy.get(`#rhsPost_${replyPost1.id}`).should('be.visible').should('contain.text', '(message deleted)');
@@ -189,7 +189,7 @@ describe('Collapsed Reply Threads', () => {
cy.reload(true);
// * There should be a single thread item with no reply
cy.get('article.ThreadItem').should('have.lengthOf', 0);
cy.get('div.ThreadItem').should('have.lengthOf', 0);
// * The reply post should not exist anymore
cy.get(`#rhsPost_${replyPost1.id}`).should('not.exist');
@@ -226,7 +226,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).first().click().within(() => {
cy.get('div.ThreadItem').should('have.lengthOf', 1).first().click().within(() => {
// * Activity section in ThreadItem should say '2 replies'
cy.get('.activity').should('have.text', '2 replies');
@@ -244,7 +244,7 @@ describe('Collapsed Reply Threads', () => {
cy.reload(true);
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).first().click().within(() => {
cy.get('div.ThreadItem').should('have.lengthOf', 1).first().click().within(() => {
// * Activity section in ThreadItem should say '1 reply'
cy.get('.activity').should('have.text', '1 reply');
@@ -295,7 +295,7 @@ describe('Collapsed Reply Threads', () => {
cy.get('#threads-list-unread-button .dot').should('have.lengthOf', 1);
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).within(() => {
cy.get('div.ThreadItem').should('have.lengthOf', 1).within(() => {
// * The unread indicator (blue dot) should be present
cy.get('.dot-unreads').should('have.lengthOf', 1);
@@ -319,7 +319,7 @@ describe('Collapsed Reply Threads', () => {
cy.get('#threads-list-unread-button .dot').should('not.exist');
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).within(() => {
cy.get('div.ThreadItem').should('have.lengthOf', 1).within(() => {
// * The unread indicator (blue dot) should NOT be present
cy.get('.dot-unreads').should('have.lengthOf', 0);
@@ -352,7 +352,7 @@ describe('Collapsed Reply Threads', () => {
cy.get('#threads-list-unread-button .dot').should('have.lengthOf', 1);
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).within(() => {
cy.get('div.ThreadItem').should('have.lengthOf', 1).within(() => {
// * The unread indicator (blue dot) should be present
cy.get('.dot-unreads').should('have.lengthOf', 1);
@@ -403,7 +403,7 @@ describe('Collapsed Reply Threads', () => {
cy.get('#threads-list-unread-button .dot').should('exist');
// * There should be a single thread item
cy.get('article.ThreadItem').should('have.lengthOf', 1).within(() => {
cy.get('div.ThreadItem').should('have.lengthOf', 1).within(() => {
// * The unread indicator (blue dot) should be present
cy.get('.dot-unreads').should('have.lengthOf', 1);
@@ -455,7 +455,7 @@ describe('Collapsed Reply Threads', () => {
cy.get('a').contains('Threads').click();
// * There should be a three threads in the threads list
cy.get('article.ThreadItem').should('have.lengthOf', 3);
cy.get('div.ThreadItem').should('have.lengthOf', 3);
// * No thread should be selected at first
cy.contains('Catch up on your threads').should('be.visible');

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

@@ -86,7 +86,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * The sole thread item should have text in footer saying '1 reply'
cy.get('article.ThreadItem').find('.activity').should('have.text', '1 reply');
cy.get('div.ThreadItem').find('.activity').should('have.text', '1 reply');
// # Visit the channel
cy.uiClickSidebarItem(testChannel.name);
@@ -107,7 +107,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * The sole thread item should have text in footer saying '2 replies'
cy.get('article.ThreadItem').find('.activity').should('have.text', '2 replies');
cy.get('div.ThreadItem').find('.activity').should('have.text', '2 replies');
// # Visit the channel
cy.uiClickSidebarItem(testChannel.name);
@@ -128,7 +128,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * The sole thread item should have text in footer saying '1 new reply'
cy.get('article.ThreadItem').find('.activity').should('have.text', '1 new reply');
cy.get('div.ThreadItem').find('.activity').should('have.text', '1 new reply');
});
it('MM-T4646 should open popover when avatar is clicked', () => {
@@ -150,7 +150,7 @@ describe('Collapsed Reply Threads', () => {
cy.uiClickSidebarItem('threads');
// * Find the first avatar and click it
cy.get('article.ThreadItem').find('.activity').find('.Avatars').find('button').first().click();
cy.get('div.ThreadItem').find('.activity').find('.Avatars').find('button').first().click();
// * Profile popover should be visible and close on ESC
cy.get('div.user-profile-popover').first().should('be.visible').find('button.btn-primary.btn-sm');

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

@@ -78,7 +78,7 @@ describe('Keyboard Shortcuts', () => {
cy.uiClickSidebarItem('threads');
// * There should be a thread there
cy.get('article.ThreadItem').should('have.have.lengthOf', 2);
cy.get('div.ThreadItem').should('have.have.lengthOf', 2);
});
// # Press CTRL/CMD+K

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

@@ -179,7 +179,7 @@ describe('Forward Message', () => {
cy.uiClickSidebarItem('threads');
// # Open the RHS with replies to the root post
cy.get('article.ThreadItem').should('have.lengthOf', 1).first().click();
cy.get('div.ThreadItem').should('have.lengthOf', 1).first().click();
// # Click on ... button of reply post
cy.clickPostDotMenu(replyPost.id, 'RHS_COMMENT');