@@ -909,7 +909,12 @@ describe('trace view', () => {
909
909
expect ( await screen . findByText ( / w e f a i l e d t o l o a d y o u r t r a c e / i) ) . toBeInTheDocument ( ) ;
910
910
} ) ;
911
911
912
- it ( 'renders empty state' , async ( ) => {
912
+ it ( 'renders empty state for successfully ingested trace' , async ( ) => {
913
+ // set timestamp to 3 minutes ago
914
+ const threeMinutesAgoInSeconds = Math . floor (
915
+ new Date ( Date . now ( ) - 3 * 60 * 1000 ) . getTime ( ) / 1000
916
+ ) ;
917
+
913
918
mockPerformanceSubscriptionDetailsResponse ( ) ;
914
919
mockTraceResponse ( {
915
920
body : {
@@ -921,12 +926,43 @@ describe('trace view', () => {
921
926
mockTraceTagsResponse ( ) ;
922
927
mockEventsResponse ( ) ;
923
928
924
- render ( < TraceView /> , { router} ) ;
929
+ window . location . search = `?timestamp=${ threeMinutesAgoInSeconds . toString ( ) } ` ;
930
+ render ( < TraceView /> , {
931
+ router,
932
+ } ) ;
925
933
expect (
926
934
await screen . findByText ( / t r a c e d o e s n o t c o n t a i n a n y d a t a / i)
927
935
) . toBeInTheDocument ( ) ;
928
936
} ) ;
929
937
938
+ it ( 'renders empty state for yet to be ingested trace' , async ( ) => {
939
+ // set timestamp to 1 minute ago
940
+ const oneMinuteAgoInSeconds = Math . floor (
941
+ new Date ( Date . now ( ) - 1 * 60 * 1000 ) . getTime ( ) / 1000
942
+ ) ;
943
+
944
+ mockPerformanceSubscriptionDetailsResponse ( ) ;
945
+ mockTraceResponse ( {
946
+ body : {
947
+ transactions : [ ] ,
948
+ orphan_errors : [ ] ,
949
+ } ,
950
+ } ) ;
951
+ mockTraceMetaResponse ( ) ;
952
+ mockTraceTagsResponse ( ) ;
953
+ mockEventsResponse ( ) ;
954
+
955
+ window . location . search = `?timestamp=${ oneMinuteAgoInSeconds . toString ( ) } ` ;
956
+ render ( < TraceView /> , {
957
+ router,
958
+ } ) ;
959
+ expect (
960
+ await screen . findByText (
961
+ / W e c o u l d s t i l l b e i n g e s t i n g t h i s t r a c e . P l e a s e w a i t a f e w s e c o n d s a n d r e f r e s h ./ i
962
+ )
963
+ ) . toBeInTheDocument ( ) ;
964
+ } ) ;
965
+
930
966
describe ( 'pageload' , ( ) => {
931
967
it ( 'scrolls to trace root' , async ( ) => {
932
968
mockQueryString ( '?node=trace-root' ) ;
0 commit comments