Skip to content

Commit 970851e

Browse files
Add tests
1 parent f9b54e7 commit 970851e

3 files changed

Lines changed: 711 additions & 94 deletions

File tree

src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ const defaultComponents = {
153153
return (
154154
<ContextMenuButton
155155
aria-label={behaviorProps.title}
156+
data-testid='dropdown-action-archive'
156157
Icon={IconArchive}
157158
{...behaviorProps}
158159
>
@@ -176,6 +177,7 @@ const defaultComponents = {
176177
return (
177178
<ContextMenuButton
178179
aria-label={title}
180+
data-testid='dropdown-action-ban'
179181
disabled={inProgress}
180182
Icon={IconNoSign}
181183
onClick={async () => {
@@ -244,6 +246,7 @@ const defaultComponents = {
244246
return (
245247
<ContextMenuButton
246248
aria-label={title}
249+
data-testid='dropdown-action-leave'
247250
disabled={inProgress}
248251
Icon={IconLeave}
249252
onClick={async (e) => {
@@ -290,6 +293,7 @@ const defaultComponents = {
290293
return (
291294
<ContextMenuButton
292295
aria-label={behaviorProps.title}
296+
data-testid='dropdown-action-mute'
293297
Icon={IconMute}
294298
{...behaviorProps}
295299
>
@@ -314,6 +318,7 @@ const defaultComponents = {
314318
return (
315319
<ContextMenuButton
316320
aria-label={title}
321+
data-testid='dropdown-action-pin'
317322
disabled={inProgress}
318323
Icon={IconPin}
319324
onClick={async (e) => {
@@ -377,6 +382,7 @@ const defaultComponents = {
377382
appearance='ghost'
378383
aria-label={behaviorProps.title}
379384
circular
385+
data-testid='quick-action-archive'
380386
size='sm'
381387
variant='secondary'
382388
{...behaviorProps}
@@ -393,6 +399,7 @@ const defaultComponents = {
393399
appearance='ghost'
394400
aria-label={behaviorProps.title}
395401
circular
402+
data-testid='quick-action-mute'
396403
size='sm'
397404
variant='secondary'
398405
{...behaviorProps}
@@ -418,6 +425,7 @@ const defaultComponents = {
418425
aria-expanded={dialogIsOpen}
419426
aria-pressed={dialogIsOpen}
420427
circular
428+
data-testid='channel-list-item-dropdown-toggle'
421429
onClick={(e) => {
422430
e.stopPropagation();
423431

src/components/ChannelListItem/ChannelListItemActionButtons.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const ChannelListItemActionButtons: ChannelListItemActionButtonsInterface
4444
className={clsx('str-chat__channel-list-item__action-buttons', {
4545
'str-chat__channel-list-item__action-buttons--active': dialogIsOpen,
4646
})}
47+
data-testid='channel-list-item-action-buttons'
4748
>
4849
{quickDropdownToggleAction && dropdownActionSet.length > 0 && (
4950
<quickDropdownToggleAction.Component ref={setReferenceElement} />
@@ -53,6 +54,7 @@ export const ChannelListItemActionButtons: ChannelListItemActionButtonsInterface
5354
))}
5455
<ContextMenuComponent
5556
className='str-chat__channel-list-item__action-buttons-context-menu'
57+
data-testid='channel-list-item-context-menu'
5658
dialogManagerId={dialogManager?.id}
5759
id={dialog.id}
5860
onClose={dialog?.close}

0 commit comments

Comments
 (0)