Skip to content

Commit 549dafd

Browse files
adhmenonPrayagGPriteshfyirsarikaakulakum
authored
feat(widgets): addd e2e tests for task list (#508)
Co-authored-by: PrayagGP <prayagganeshprabhu.221cs140@nitk.edu.in> Co-authored-by: Ritesh Singh <riteshfyi@gmail.com> Co-authored-by: rsarika <95286093+rsarika@users.noreply.github.com> Co-authored-by: “Akula <akulakum@cisco.com>
1 parent 1b34046 commit 549dafd

8 files changed

Lines changed: 428 additions & 2 deletions

File tree

packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const CallControlCADComponent: React.FC<CallControlComponentProps> = (props) =>
166166
<div className="customer-info">
167167
{renderCustomerName()}
168168
<div className="call-details">
169-
<Text className="call-timer" type="body-secondary" tagName={'small'}>
169+
<Text className="call-timer" type="body-secondary" tagName={'small'} data-testid="cc-cad:call-timer">
170170
{currentMediaType.labelName} - <TaskTimer startTimeStamp={startTimestamp} />
171171
</Text>
172172
<div className="call-status">

packages/contact-center/cc-components/src/components/task/Task/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const Task: React.FC<TaskProps> = ({
6767
type={selected ? 'body-large-bold' : 'body-large-medium'}
6868
className={taskData.titleClassName}
6969
id={taskData.isNonVoiceMedia ? taskData.tooltipTriggerId : undefined}
70+
data-testid="task:title"
7071
>
7172
{title}
7273
</Text>
@@ -145,7 +146,7 @@ const Task: React.FC<TaskProps> = ({
145146
data-testid={`${interactionId}-handle-time`}
146147
>
147148
Handle Time: {' '}
148-
<TaskTimer startTimeStamp={startTimeStamp} />
149+
<TaskTimer startTimeStamp={startTimeStamp} data-testid="task-list:timer" />
149150
</Text>
150151
)}
151152

packages/contact-center/cc-components/tests/components/task/CallControlCAD/__snapshots__/call-control-cad.snapshot.tsx.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ exports[`CallControlCADComponent Snapshots should handle edge cases and control
2828
>
2929
<mdc-text
3030
class="md-text-wrapper call-timer"
31+
data-testid="cc-cad:call-timer"
3132
>
3233
Voice
3334
-
@@ -213,6 +214,7 @@ exports[`CallControlCADComponent Snapshots should handle edge cases and control
213214
>
214215
<mdc-text
215216
class="md-text-wrapper call-timer"
217+
data-testid="cc-cad:call-timer"
216218
>
217219
Voice
218220
-
@@ -362,6 +364,7 @@ exports[`CallControlCADComponent Snapshots should handle edge cases and control
362364
>
363365
<mdc-text
364366
class="md-text-wrapper call-timer"
367+
data-testid="cc-cad:call-timer"
365368
>
366369
Voice
367370
-
@@ -639,6 +642,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m
639642
>
640643
<mdc-text
641644
class="md-text-wrapper call-timer"
645+
data-testid="cc-cad:call-timer"
642646
>
643647
Chat
644648
-
@@ -916,6 +920,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m
916920
>
917921
<mdc-text
918922
class="md-text-wrapper call-timer"
923+
data-testid="cc-cad:call-timer"
919924
>
920925
Voice
921926
-
@@ -1203,6 +1208,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m
12031208
>
12041209
<mdc-text
12051210
class="md-text-wrapper call-timer"
1211+
data-testid="cc-cad:call-timer"
12061212
>
12071213
Voice
12081214
-
@@ -1480,6 +1486,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m
14801486
>
14811487
<mdc-text
14821488
class="md-text-wrapper call-timer"
1489+
data-testid="cc-cad:call-timer"
14831490
>
14841491
Social
14851492
-
@@ -1758,6 +1765,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup
17581765
>
17591766
<mdc-text
17601767
class="md-text-wrapper call-timer"
1768+
data-testid="cc-cad:call-timer"
17611769
>
17621770
Voice
17631771
-
@@ -1943,6 +1951,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup
19431951
>
19441952
<mdc-text
19451953
class="md-text-wrapper call-timer"
1954+
data-testid="cc-cad:call-timer"
19461955
>
19471956
Voice
19481957
-
@@ -2048,6 +2057,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup
20482057
>
20492058
<mdc-text
20502059
class="md-text-wrapper call-timer"
2060+
data-testid="cc-cad:call-timer"
20512061
>
20522062
Voice
20532063
-
@@ -2379,6 +2389,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup
23792389
>
23802390
<mdc-text
23812391
class="md-text-wrapper call-timer"
2392+
data-testid="cc-cad:call-timer"
23822393
>
23832394
Voice
23842395
-

packages/contact-center/cc-components/tests/components/task/IncomingTask/__snapshots__/incoming-task.snapshot.tsx.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ exports[`IncomingTaskComponent Actions should call acceptTask when accept button
3131
>
3232
<mdc-text
3333
class="md-text-wrapper task-title"
34+
data-testid="task:title"
3435
tagname="span"
3536
type="body-large-medium"
3637
>
@@ -142,6 +143,7 @@ exports[`IncomingTaskComponent Actions should call acceptTask when accept button
142143
>
143144
<mdc-text
144145
class="md-text-wrapper task-title"
146+
data-testid="task:title"
145147
tagname="span"
146148
type="body-large-medium"
147149
>
@@ -253,6 +255,7 @@ exports[`IncomingTaskComponent Actions should call declineTask when decline butt
253255
>
254256
<mdc-text
255257
class="md-text-wrapper task-title"
258+
data-testid="task:title"
256259
tagname="span"
257260
type="body-large-medium"
258261
>
@@ -364,6 +367,7 @@ exports[`IncomingTaskComponent Actions should call declineTask when decline butt
364367
>
365368
<mdc-text
366369
class="md-text-wrapper task-title"
370+
data-testid="task:title"
367371
tagname="span"
368372
type="body-large-medium"
369373
>
@@ -480,6 +484,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render digit
480484
<mdc-text
481485
aria-describedby="tooltip-incoming-chat-task"
482486
class="md-text-wrapper incoming-digital-task-title"
487+
data-testid="task:title"
483488
id="tooltip-trigger-incoming-chat-task"
484489
tagname="span"
485490
type="body-large-medium"
@@ -594,6 +599,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render multi
594599
>
595600
<mdc-text
596601
class="md-text-wrapper task-title"
602+
data-testid="task:title"
597603
tagname="span"
598604
type="body-large-medium"
599605
>
@@ -705,6 +711,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render multi
705711
>
706712
<mdc-text
707713
class="md-text-wrapper task-title"
714+
data-testid="task:title"
708715
tagname="span"
709716
type="body-large-medium"
710717
>
@@ -798,6 +805,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render multi
798805
<mdc-text
799806
aria-describedby="tooltip-chat-task"
800807
class="md-text-wrapper incoming-digital-task-title"
808+
data-testid="task:title"
801809
id="tooltip-trigger-chat-task"
802810
tagname="span"
803811
type="body-large-medium"
@@ -916,6 +924,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render multi
916924
<mdc-text
917925
aria-describedby="tooltip-social-task"
918926
class="md-text-wrapper incoming-digital-task-title"
927+
data-testid="task:title"
919928
id="tooltip-trigger-social-task"
920929
tagname="span"
921930
type="body-large-medium"
@@ -1030,6 +1039,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render telep
10301039
>
10311040
<mdc-text
10321041
class="md-text-wrapper task-title"
1042+
data-testid="task:title"
10331043
tagname="span"
10341044
type="body-large-medium"
10351045
>
@@ -1141,6 +1151,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render telep
11411151
>
11421152
<mdc-text
11431153
class="md-text-wrapper task-title"
1154+
data-testid="task:title"
11441155
tagname="span"
11451156
type="body-large-medium"
11461157
>

packages/contact-center/cc-components/tests/components/task/TaskList/__snapshots__/task-list.snapshot.tsx.snap

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ exports[`TaskListComponent Actions should call acceptTask when accept button is
3535
>
3636
<mdc-text
3737
class="md-text-wrapper task-title"
38+
data-testid="task:title"
3839
tagname="span"
3940
type="body-large-medium"
4041
>
@@ -151,6 +152,7 @@ exports[`TaskListComponent Actions should call acceptTask when accept button is
151152
>
152153
<mdc-text
153154
class="md-text-wrapper task-title"
155+
data-testid="task:title"
154156
tagname="span"
155157
type="body-large-medium"
156158
>
@@ -267,6 +269,7 @@ exports[`TaskListComponent Actions should call declineTask when decline button i
267269
>
268270
<mdc-text
269271
class="md-text-wrapper task-title"
272+
data-testid="task:title"
270273
tagname="span"
271274
type="body-large-medium"
272275
>
@@ -383,6 +386,7 @@ exports[`TaskListComponent Actions should call declineTask when decline button i
383386
>
384387
<mdc-text
385388
class="md-text-wrapper task-title"
389+
data-testid="task:title"
386390
tagname="span"
387391
type="body-large-medium"
388392
>
@@ -499,6 +503,7 @@ exports[`TaskListComponent Actions should call onTaskSelect when task is clicked
499503
>
500504
<mdc-text
501505
class="md-text-wrapper task-title"
506+
data-testid="task:title"
502507
tagname="span"
503508
type="body-large-medium"
504509
>
@@ -576,6 +581,7 @@ exports[`TaskListComponent Actions should call onTaskSelect when task is clicked
576581
>
577582
<mdc-text
578583
class="md-text-wrapper task-title"
584+
data-testid="task:title"
579585
tagname="span"
580586
type="body-large-medium"
581587
>
@@ -653,6 +659,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple
653659
>
654660
<mdc-text
655661
class="md-text-wrapper task-title"
662+
data-testid="task:title"
656663
tagname="span"
657664
type="body-large-bold"
658665
>
@@ -760,6 +767,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple
760767
<mdc-text
761768
aria-describedby="tooltip-unselected-chat-task"
762769
class="md-text-wrapper task-digital-title"
770+
data-testid="task:title"
763771
id="tooltip-trigger-unselected-chat-task"
764772
tagname="span"
765773
type="body-large-medium"
@@ -859,6 +867,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple
859867
>
860868
<mdc-text
861869
class="md-text-wrapper task-title"
870+
data-testid="task:title"
862871
tagname="span"
863872
type="body-large-bold"
864873
>
@@ -966,6 +975,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple
966975
<mdc-text
967976
aria-describedby="tooltip-unselected-chat-task"
968977
class="md-text-wrapper task-digital-title"
978+
data-testid="task:title"
969979
id="tooltip-trigger-unselected-chat-task"
970980
tagname="span"
971981
type="body-large-medium"
@@ -1072,6 +1082,7 @@ exports[`TaskListComponent Rendering with Tasks should render digital incoming t
10721082
<mdc-text
10731083
aria-describedby="tooltip-incoming-chat-task"
10741084
class="md-text-wrapper incoming-digital-task-title"
1085+
data-testid="task:title"
10751086
id="tooltip-trigger-incoming-chat-task"
10761087
tagname="span"
10771088
type="body-large-medium"
@@ -1191,6 +1202,7 @@ exports[`TaskListComponent Rendering with Tasks should render multiple tasks wit
11911202
>
11921203
<mdc-text
11931204
class="md-text-wrapper task-title"
1205+
data-testid="task:title"
11941206
tagname="span"
11951207
type="body-large-medium"
11961208
>
@@ -1259,6 +1271,7 @@ exports[`TaskListComponent Rendering with Tasks should render multiple tasks wit
12591271
<mdc-text
12601272
aria-describedby="tooltip-chat-task"
12611273
class="md-text-wrapper task-digital-title"
1274+
data-testid="task:title"
12621275
id="tooltip-trigger-chat-task"
12631276
tagname="span"
12641277
type="body-large-medium"
@@ -1352,6 +1365,7 @@ exports[`TaskListComponent Rendering with Tasks should render multiple tasks wit
13521365
<mdc-text
13531366
aria-describedby="tooltip-social-task"
13541367
class="md-text-wrapper task-digital-title"
1368+
data-testid="task:title"
13551369
id="tooltip-trigger-social-task"
13561370
tagname="span"
13571371
type="body-large-medium"
@@ -1451,6 +1465,7 @@ exports[`TaskListComponent Rendering with Tasks should render telephony incoming
14511465
>
14521466
<mdc-text
14531467
class="md-text-wrapper task-title"
1468+
data-testid="task:title"
14541469
tagname="span"
14551470
type="body-large-medium"
14561471
>
@@ -1567,6 +1582,7 @@ exports[`TaskListComponent Rendering with Tasks should render telephony incoming
15671582
>
15681583
<mdc-text
15691584
class="md-text-wrapper task-title"
1585+
data-testid="task:title"
15701586
tagname="span"
15711587
type="body-large-medium"
15721588
>
@@ -1664,6 +1680,7 @@ exports[`TaskListComponent Rendering with Tasks should show selected state with
16641680
>
16651681
<mdc-text
16661682
class="md-text-wrapper task-title"
1683+
data-testid="task:title"
16671684
tagname="span"
16681685
type="body-large-bold"
16691686
>

0 commit comments

Comments
 (0)