@@ -369,6 +369,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
369
369
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
370
370
formatted_body: ` question #${i + 1 } ` ,
371
371
format: ' org.matrix.custom.html' ,
372
+ isStreamingFinished: true ,
372
373
});
373
374
let eventId = simulateRemoteMessage (roomId , ' @aibot:localhost' , {
374
375
body: ` answer #${i + 1 } ` ,
@@ -397,6 +398,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
397
398
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
398
399
formatted_body: ' A patch' ,
399
400
format: ' org.matrix.custom.html' ,
401
+ isStreamingFinished: true ,
400
402
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
401
403
{
402
404
name: ' patchCard' ,
@@ -425,7 +427,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
425
427
});
426
428
await click (' [data-test-command-apply]' );
427
429
await waitFor (' [data-test-command-card-idle]' );
428
-
429
430
assert .dom (' [data-test-person]' ).hasText (' Dave' );
430
431
});
431
432
@@ -453,6 +454,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
453
454
body: ' Incorrect command' ,
454
455
formatted_body: ' Incorrect command' ,
455
456
format: ' org.matrix.custom.html' ,
457
+ isStreamingFinished: true ,
456
458
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
457
459
{
458
460
id: ' d60582a6-8792-4505-8d38-656c1167f00d' ,
@@ -463,17 +465,14 @@ module('Integration | ai-assistant-panel', function (hooks) {
463
465
},
464
466
},
465
467
],
466
- ' m.relates_to' : {
467
- rel_type: ' m.replace' ,
468
- event_id: ' __EVENT_ID__' ,
469
- },
470
468
});
471
469
472
470
simulateRemoteMessage (room1Id , ' @aibot:localhost' , {
473
471
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
474
472
body: ' Changing first name to Evie' ,
475
473
formatted_body: ' Changing first name to Evie' ,
476
474
format: ' org.matrix.custom.html' ,
475
+ isStreamingFinished: true ,
477
476
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
478
477
{
479
478
id: ' 444ac6ed-eea2-459b-93f7-56117bf54f50' ,
@@ -488,17 +487,14 @@ module('Integration | ai-assistant-panel', function (hooks) {
488
487
},
489
488
},
490
489
],
491
- ' m.relates_to' : {
492
- rel_type: ' m.replace' ,
493
- event_id: ' __EVENT_ID__' ,
494
- },
495
490
});
496
491
497
492
simulateRemoteMessage (room1Id , ' @aibot:localhost' , {
498
493
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
499
494
body: ' Changing first name to Jackie' ,
500
495
formatted_body: ' Changing first name to Jackie' ,
501
496
format: ' org.matrix.custom.html' ,
497
+ isStreamingFinished: true ,
502
498
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
503
499
{
504
500
id: ' cddecff1-8f26-4170-91bf-5a2192fb2459' ,
@@ -513,10 +509,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
513
509
},
514
510
},
515
511
],
516
- ' m.relates_to' : {
517
- rel_type: ' m.replace' ,
518
- event_id: ' __EVENT_ID__' ,
519
- },
520
512
});
521
513
522
514
// let the room events all process before we open the assistant, so it will
@@ -596,6 +588,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
596
588
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
597
589
formatted_body: ' A patch' ,
598
590
format: ' org.matrix.custom.html' ,
591
+ isStreamingFinished: true ,
599
592
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [payload ],
600
593
' m.relates_to' : {
601
594
rel_type: ' m.replace' ,
@@ -655,6 +648,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
655
648
body: ' Removing pet and changing preferred carrier' ,
656
649
formatted_body: ' Removing pet and changing preferred carrier' ,
657
650
format: ' org.matrix.custom.html' ,
651
+ isStreamingFinished: true ,
658
652
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
659
653
{
660
654
name: ' patchCard' ,
@@ -673,10 +667,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
673
667
},
674
668
},
675
669
],
676
- ' m.relates_to' : {
677
- rel_type: ' m.replace' ,
678
- event_id: ' __EVENT_ID__' ,
679
- },
680
670
});
681
671
682
672
const stackCard = ` [data-test-stack-card="${id }"] ` ;
@@ -696,6 +686,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
696
686
body: ' Link to pet and change preferred carrier' ,
697
687
formatted_body: ' Link to pet and change preferred carrier' ,
698
688
format: ' org.matrix.custom.html' ,
689
+ isStreamingFinished: true ,
699
690
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
700
691
{
701
692
name: ' patchCard' ,
@@ -762,6 +753,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
762
753
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
763
754
formatted_body: ' A patch' ,
764
755
format: ' org.matrix.custom.html' ,
756
+ isStreamingFinished: true ,
765
757
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [payload ],
766
758
});
767
759
@@ -818,6 +810,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
818
810
body: ' Change tripTitle to Trip to Japan' ,
819
811
formatted_body: ' Change tripTitle to Trip to Japan' ,
820
812
format: ' org.matrix.custom.html' ,
813
+ isStreamingFinished: true ,
821
814
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
822
815
{
823
816
name: ' patchCard' ,
@@ -835,10 +828,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
835
828
},
836
829
},
837
830
],
838
- ' m.relates_to' : {
839
- rel_type: ' m.replace' ,
840
- event_id: ' __EVENT_ID__' ,
841
- },
842
831
});
843
832
844
833
await waitFor (' [data-test-command-apply="ready"]' );
@@ -859,6 +848,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
859
848
body: ' Change first name to Dave' ,
860
849
formatted_body: ' Change first name to Dave' ,
861
850
format: ' org.matrix.custom.html' ,
851
+ isStreamingFinished: true ,
862
852
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
863
853
{
864
854
id: ' 8c848ebb-3e09-4ba3-b21d-348bdd7bd1ff' ,
@@ -873,16 +863,13 @@ module('Integration | ai-assistant-panel', function (hooks) {
873
863
},
874
864
},
875
865
],
876
- ' m.relates_to' : {
877
- rel_type: ' m.replace' ,
878
- event_id: ' __EVENT_ID__' ,
879
- },
880
866
});
881
867
simulateRemoteMessage (roomId , ' @aibot:localhost' , {
882
868
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
883
869
body: ' Incorrect patch command' ,
884
870
formatted_body: ' Incorrect patch command' ,
885
871
format: ' org.matrix.custom.html' ,
872
+ isStreamingFinished: true ,
886
873
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
887
874
{
888
875
id: ' 773c6c9b-a247-4099-8ec0-44f3ea197938' ,
@@ -893,16 +880,13 @@ module('Integration | ai-assistant-panel', function (hooks) {
893
880
},
894
881
},
895
882
],
896
- ' m.relates_to' : {
897
- rel_type: ' m.replace' ,
898
- event_id: ' __EVENT_ID__' ,
899
- },
900
883
});
901
884
simulateRemoteMessage (roomId , ' @aibot:localhost' , {
902
885
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
903
886
body: ' Change first name to Jackie and switch to code mode' ,
904
887
formatted_body: ' Change first name to Jackie and switch to code mode' ,
905
888
format: ' org.matrix.custom.html' ,
889
+ isStreamingFinished: true ,
906
890
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
907
891
{
908
892
id: ' 127538b2-b0d1-4902-bd09-1fdf55063f07' ,
@@ -926,10 +910,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
926
910
},
927
911
},
928
912
],
929
- ' m.relates_to' : {
930
- rel_type: ' m.replace' ,
931
- event_id: ' __EVENT_ID__' ,
932
- },
933
913
});
934
914
935
915
await waitFor (' [data-test-command-apply="ready"]' , { count: 4 });
@@ -985,6 +965,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
985
965
body: ' Change first name to Dave' ,
986
966
formatted_body: ' Change first name to Dave' ,
987
967
format: ' org.matrix.custom.html' ,
968
+ isStreamingFinished: true ,
988
969
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
989
970
{
990
971
name: ' patchCard' ,
@@ -998,10 +979,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
998
979
},
999
980
},
1000
981
],
1001
- ' m.relates_to' : {
1002
- rel_type: ' m.replace' ,
1003
- event_id: ' __EVENT_ID__' ,
1004
- },
1005
982
});
1006
983
1007
984
await waitFor (' [data-test-command-apply="ready"]' , { count: 1 });
@@ -1083,6 +1060,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
1083
1060
data: JSON .stringify ({
1084
1061
attachedCardsEventIds: [cardFragmentsEventId ],
1085
1062
}),
1063
+ isStreamingFinished: true ,
1086
1064
},
1087
1065
{ origin_server_ts: now + 60000 },
1088
1066
);
@@ -1128,6 +1106,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
1128
1106
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
1129
1107
formatted_body: ` question #1 ` ,
1130
1108
format: ' org.matrix.custom.html' ,
1109
+ isStreamingFinished: true ,
1131
1110
});
1132
1111
let messageEventId = simulateRemoteMessage (roomId , ' @aibot:localhost' , {
1133
1112
body: ` Thinking... ` ,
@@ -1141,6 +1120,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
1141
1120
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
1142
1121
formatted_body: ` Thinking... ` ,
1143
1122
format: ' org.matrix.custom.html' ,
1123
+ isStreamingFinished: true ,
1144
1124
});
1145
1125
setReadReceipt (roomId , messageEventId , ' @testuser:localhost' );
1146
1126
setReadReceipt (roomId , commandEventId , ' @testuser:localhost' );
@@ -1181,6 +1161,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
1181
1161
event_id: commandEventId ,
1182
1162
rel_type: ' m.replace' ,
1183
1163
},
1164
+ isStreamingFinished: true ,
1184
1165
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
1185
1166
{
1186
1167
name: ' patchCard' ,
@@ -1630,6 +1611,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
1630
1611
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
1631
1612
formatted_body: ' A patch' ,
1632
1613
format: ' org.matrix.custom.html' ,
1614
+ isStreamingFinished: true ,
1633
1615
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
1634
1616
{
1635
1617
id: ' fb8fef81-2142-4861-a902-d5614b0aea52' ,
@@ -1644,10 +1626,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
1644
1626
},
1645
1627
},
1646
1628
],
1647
- ' m.relates_to' : {
1648
- rel_type: ' m.replace' ,
1649
- event_id: ' patch1' ,
1650
- },
1651
1629
});
1652
1630
1653
1631
await waitFor (' [data-test-message-idx="0"]' );
@@ -2471,7 +2449,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
2471
2449
);
2472
2450
await waitFor (' [data-test-person="Fadhlan"]' );
2473
2451
let roomId = createAndJoinRoom ({
2474
- sender: ' @testuser:staging ' ,
2452
+ sender: ' @testuser:localhost ' ,
2475
2453
name: ' test room 1' ,
2476
2454
});
2477
2455
let initialEventId = simulateRemoteMessage (roomId , ' @aibot:localhost' , {
@@ -2510,7 +2488,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
2510
2488
.exists ();
2511
2489
});
2512
2490
2513
- test (' after command is issued, a reaction event will be dispatched ' , async function (assert ) {
2491
+ test (' when command is done streaming, apply button is shown in ready state ' , async function (assert ) {
2514
2492
await setCardInOperatorModeState (` ${testRealmURL }Person/fadhlan ` );
2515
2493
await renderComponent (
2516
2494
class TestDriver extends GlimmerComponent {
@@ -2670,6 +2648,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
2670
2648
body: ' Changing first name to Evie' ,
2671
2649
formatted_body: ' Changing first name to Evie' ,
2672
2650
format: ' org.matrix.custom.html' ,
2651
+ isStreamingFinished: true ,
2673
2652
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
2674
2653
{
2675
2654
name: ' patchCard' ,
@@ -2683,10 +2662,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
2683
2662
},
2684
2663
},
2685
2664
],
2686
- ' m.relates_to' : {
2687
- rel_type: ' m.replace' ,
2688
- event_id: ' __EVENT_ID__' ,
2689
- },
2690
2665
});
2691
2666
let commandResultEvents = getRoomEvents (roomId ).filter (
2692
2667
(event ) =>
@@ -2747,6 +2722,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
2747
2722
msgtype: APP_BOXEL_MESSAGE_MSGTYPE ,
2748
2723
formatted_body: ' Changing first name to Evie' ,
2749
2724
format: ' org.matrix.custom.html' ,
2725
+ isStreamingFinished: true ,
2750
2726
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
2751
2727
{
2752
2728
name: ' patchCard' ,
@@ -2760,10 +2736,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
2760
2736
},
2761
2737
},
2762
2738
],
2763
- ' m.relates_to' : {
2764
- rel_type: ' m.replace' ,
2765
- event_id: ' __EVENT_ID__' ,
2766
- },
2767
2739
});
2768
2740
let commandResultEvents = getRoomEvents (roomId ).filter (
2769
2741
(event ) => event .type === APP_BOXEL_COMMAND_RESULT_EVENT_TYPE ,
@@ -3092,6 +3064,7 @@ module('Integration | ai-assistant-panel', function (hooks) {
3092
3064
body: ' Changing first name to Evie' ,
3093
3065
formatted_body: ' Changing first name to Evie' ,
3094
3066
format: ' org.matrix.custom.html' ,
3067
+ isStreamingFinished: true ,
3095
3068
[APP_BOXEL_COMMAND_REQUESTS_KEY ]: [
3096
3069
{
3097
3070
name: ' patchCard' ,
@@ -3105,10 +3078,6 @@ module('Integration | ai-assistant-panel', function (hooks) {
3105
3078
},
3106
3079
},
3107
3080
],
3108
- ' m.relates_to' : {
3109
- rel_type: ' m.replace' ,
3110
- event_id: ' __EVENT_ID__' ,
3111
- },
3112
3081
});
3113
3082
3114
3083
await settled ();
0 commit comments