(index: number)
| 540 | |
| 541 | // Focus on the conversation with the given index |
| 542 | async function selectConversation(index: number): Promise<void> { |
| 543 | const list = await elementReady(selectors.conversationList, {stopOnDomReady: false}); |
| 544 | |
| 545 | if (!list) { |
| 546 | console.error('Could not find conversations list', selectors.conversationList); |
| 547 | return; |
| 548 | } |
| 549 | |
| 550 | const conversation = list.children[index]; |
| 551 | |
| 552 | if (!conversation) { |
| 553 | console.error('Could not find conversation', index); |
| 554 | return; |
| 555 | } |
| 556 | |
| 557 | conversation.querySelector<HTMLLegendElement>('[role=link]')!.click(); |
| 558 | } |
| 559 | |
| 560 | function selectedConversationIndex(offset = 0): number { |
| 561 | const selected = document.querySelector<HTMLElement>(selectors.selectedConversation); |
no outgoing calls
no test coverage detected