@@ -735,23 +735,24 @@ describe("Read receipts", () => {
735
735
describe ( "editing messages" , ( ) => {
736
736
describe ( "in the main timeline" , ( ) => {
737
737
// TODO: this passes but we think this should fail, because we think edits should not cause unreads.
738
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
738
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
739
739
it . skip ( "Editing a message makes a room unread" , ( ) => {
740
740
// Given I am not looking at the room
741
741
goTo ( room1 ) ;
742
742
743
743
receiveMessages ( room2 , [ "Msg1" ] ) ;
744
744
assertUnread ( room2 , 1 ) ;
745
- markAsRead ( room2 ) ;
745
+ goTo ( room2 ) ;
746
746
assertRead ( room2 ) ;
747
+ goTo ( room1 ) ;
747
748
748
749
// When an edit appears in the room
749
750
receiveMessages ( room2 , [ editOf ( "Msg1" , "Msg1 Edit1" ) ] ) ;
750
751
751
752
// Then it becomes unread
752
753
assertUnread ( room2 , 1 ) ;
753
754
} ) ;
754
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
755
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
755
756
it . skip ( "Reading an edit makes the room read" , ( ) => {
756
757
// Given an edit is making the room unread
757
758
goTo ( room1 ) ;
@@ -773,14 +774,12 @@ describe("Read receipts", () => {
773
774
goTo ( room1 ) ;
774
775
assertRead ( room2 ) ;
775
776
} ) ;
776
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
777
- it . skip ( "Marking a room as read after an edit makes it read" , ( ) => {
778
- // Given an edit is makng a room unread
779
- goTo ( room1 ) ;
777
+ it ( "Marking a room as read after an edit makes it read" , ( ) => {
778
+ // Given an edit is making a room unread
779
+ goTo ( room2 ) ;
780
780
receiveMessages ( room2 , [ "Msg1" ] ) ;
781
- assertUnread ( room2 , 1 ) ;
782
- markAsRead ( room2 ) ;
783
781
assertRead ( room2 ) ;
782
+ goTo ( room1 ) ;
784
783
receiveMessages ( room2 , [ editOf ( "Msg1" , "Msg1 Edit1" ) ] ) ;
785
784
assertUnread ( room2 , 1 ) ;
786
785
@@ -790,7 +789,7 @@ describe("Read receipts", () => {
790
789
// Then the room becomes read
791
790
assertRead ( room2 ) ;
792
791
} ) ;
793
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
792
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
794
793
it . skip ( "Editing a message after marking as read makes the room unread" , ( ) => {
795
794
// Given the room is marked as read
796
795
goTo ( room1 ) ;
@@ -805,7 +804,7 @@ describe("Read receipts", () => {
805
804
// Then the room becomes unread
806
805
assertUnread ( room2 , 1 ) ;
807
806
} ) ;
808
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
807
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
809
808
it . skip ( "Editing a reply after reading it makes the room unread" , ( ) => {
810
809
// Given the room is all read
811
810
goTo ( room1 ) ;
@@ -823,7 +822,7 @@ describe("Read receipts", () => {
823
822
// Then it becomes unread
824
823
assertUnread ( room2 , 1 ) ;
825
824
} ) ;
826
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
825
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
827
826
it . skip ( "Editing a reply after marking as read makes the room unread" , ( ) => {
828
827
// Given a reply is marked as read
829
828
goTo ( room1 ) ;
@@ -838,14 +837,13 @@ describe("Read receipts", () => {
838
837
// Then the room becomes unread
839
838
assertUnread ( room2 , 1 ) ;
840
839
} ) ;
841
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
840
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
842
841
it . skip ( "A room with an edit is still unread after restart" , ( ) => {
843
842
// Given a message is marked as read
844
- goTo ( room1 ) ;
843
+ goTo ( room2 ) ;
845
844
receiveMessages ( room2 , [ "Msg1" ] ) ;
846
- assertUnread ( room2 , 1 ) ;
847
- markAsRead ( room2 ) ;
848
845
assertRead ( room2 ) ;
846
+ goTo ( room1 ) ;
849
847
850
848
// When an edit appears in the room
851
849
receiveMessages ( room2 , [ editOf ( "Msg1" , "Msg1 Edit1" ) ] ) ;
@@ -857,13 +855,22 @@ describe("Read receipts", () => {
857
855
saveAndReload ( ) ;
858
856
assertUnread ( room2 , 1 ) ;
859
857
} ) ;
860
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
861
- it . skip ( "A room where all edits are read is still read after restart" , ( ) => {
858
+ it ( "An edited message becomes read if it happens while I am looking" , ( ) => {
859
+ // Given a message is marked as read
860
+ goTo ( room2 ) ;
861
+ receiveMessages ( room2 , [ "Msg1" ] ) ;
862
+ assertRead ( room2 ) ;
863
+
864
+ // When I see an edit appear in the room I am looking at
865
+ receiveMessages ( room2 , [ editOf ( "Msg1" , "Msg1 Edit1" ) ] ) ;
866
+
867
+ // Then it becomes read
868
+ assertRead ( room2 ) ;
869
+ } ) ;
870
+ it ( "A room where all edits are read is still read after restart" , ( ) => {
862
871
// Given an edit made the room unread
863
- goTo ( room1 ) ;
872
+ goTo ( room2 ) ;
864
873
receiveMessages ( room2 , [ "Msg1" ] ) ;
865
- assertUnread ( room2 , 1 ) ;
866
- markAsRead ( room2 ) ;
867
874
assertRead ( room2 ) ;
868
875
receiveMessages ( room2 , [ editOf ( "Msg1" , "Msg1 Edit1" ) ] ) ;
869
876
assertUnread ( room2 , 1 ) ;
@@ -881,7 +888,7 @@ describe("Read receipts", () => {
881
888
} ) ;
882
889
883
890
describe ( "in threads" , ( ) => {
884
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
891
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
885
892
it . skip ( "An edit of a threaded message makes the room unread" , ( ) => {
886
893
goTo ( room1 ) ;
887
894
receiveMessages ( room2 , [ "Msg1" , threadedOff ( "Msg1" , "Resp1" ) ] ) ;
@@ -895,7 +902,7 @@ describe("Read receipts", () => {
895
902
receiveMessages ( room2 , [ editOf ( "Resp1" , "Edit1" ) ] ) ;
896
903
assertUnread ( room2 , 1 ) ;
897
904
} ) ;
898
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
905
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
899
906
it . skip ( "Reading an edit of a threaded message makes the room read" , ( ) => {
900
907
goTo ( room1 ) ;
901
908
receiveMessages ( room2 , [ "Msg1" , threadedOff ( "Msg1" , "Resp1" ) ] ) ;
@@ -940,7 +947,7 @@ describe("Read receipts", () => {
940
947
// Then the room becomes unread
941
948
assertUnread ( room2 , 1 ) ; // TODO: should this edit make us unread?
942
949
} ) ;
943
- // XXX: fails because on CI the count is 2 instead of 3. Must be a timing issue.
950
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
944
951
it . skip ( "A room with an edited threaded message is still unread after restart" , ( ) => {
945
952
goTo ( room1 ) ;
946
953
receiveMessages ( room2 , [ "Msg1" , threadedOff ( "Msg1" , "Resp1" ) , editOf ( "Resp1" , "Edit1" ) ] ) ;
@@ -949,8 +956,20 @@ describe("Read receipts", () => {
949
956
saveAndReload ( ) ;
950
957
assertUnread ( room2 , 3 ) ;
951
958
} ) ;
952
- // XXX: fails because on CI the count is 2 instead of 3. Must be a timing issue.
953
- it . skip ( "A room where all threaded edits are read is still read after restart" , ( ) => {
959
+ it ( "A room where all threaded edits are read is still read after restart" , ( ) => {
960
+ goTo ( room2 ) ;
961
+ receiveMessages ( room2 , [ "Msg1" , threadedOff ( "Msg1" , "Resp1" ) , editOf ( "Resp1" , "Edit1" ) ] ) ;
962
+ assertUnread ( room2 , 2 ) ;
963
+ openThread ( "Msg1" ) ;
964
+ assertRead ( room2 ) ;
965
+ goTo ( room1 ) ; // Make sure we are looking at room1 after reload
966
+ assertRead ( room2 ) ;
967
+
968
+ saveAndReload ( ) ;
969
+ assertRead ( room2 ) ;
970
+ } ) ;
971
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
972
+ it . skip ( "A room where all threaded edits are marked as read is still read after restart" , ( ) => {
954
973
goTo ( room1 ) ;
955
974
receiveMessages ( room2 , [ "Msg1" , threadedOff ( "Msg1" , "Resp1" ) , editOf ( "Resp1" , "Edit1" ) ] ) ;
956
975
assertUnread ( room2 , 3 ) ;
@@ -964,7 +983,7 @@ describe("Read receipts", () => {
964
983
} ) ;
965
984
966
985
describe ( "thread roots" , ( ) => {
967
- // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
986
+ // XXX: fails because we see a dot instead of an unread number - probably the server and client disagree
968
987
it . skip ( "An edit of a thread root makes the room unread" , ( ) => {
969
988
goTo ( room1 ) ;
970
989
receiveMessages ( room2 , [ "Msg1" , threadedOff ( "Msg1" , "Resp1" ) ] ) ;
0 commit comments