@@ -15,18 +15,13 @@ afterEach(() => {
1515 WINDOW . sessionStorage . clear ( ) ;
1616} ) ;
1717
18- const SAMPLE_RATES = {
19- sessionSampleRate : 1.0 ,
20- errorSampleRate : 0.0 ,
21- } ;
22-
2318it ( 'fetches a valid and sampled session' , function ( ) {
2419 WINDOW . sessionStorage . setItem (
2520 REPLAY_SESSION_KEY ,
2621 '{"id":"fd09adfc4117477abc8de643e5a5798a","sampled": "session","started":1648827162630,"lastActivity":1648827162658}' ,
2722 ) ;
2823
29- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( {
24+ expect ( fetchSession ( ) ) . toEqual ( {
3025 id : 'fd09adfc4117477abc8de643e5a5798a' ,
3126 lastActivity : 1648827162658 ,
3227 segmentId : 0 ,
@@ -41,7 +36,7 @@ it('fetches an unsampled session', function () {
4136 '{"id":"fd09adfc4117477abc8de643e5a5798a","sampled": false,"started":1648827162630,"lastActivity":1648827162658}' ,
4237 ) ;
4338
44- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( {
39+ expect ( fetchSession ( ) ) . toEqual ( {
4540 id : 'fd09adfc4117477abc8de643e5a5798a' ,
4641 lastActivity : 1648827162658 ,
4742 segmentId : 0 ,
@@ -50,29 +45,14 @@ it('fetches an unsampled session', function () {
5045 } ) ;
5146} ) ;
5247
53- it ( 'auto-fixes a session without sampled' , function ( ) {
54- WINDOW . sessionStorage . setItem (
55- REPLAY_SESSION_KEY ,
56- '{"id":"fd09adfc4117477abc8de643e5a5798a","started":1648827162630,"lastActivity":1648827162658}' ,
57- ) ;
58-
59- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( {
60- id : 'fd09adfc4117477abc8de643e5a5798a' ,
61- lastActivity : 1648827162658 ,
62- segmentId : 0 ,
63- sampled : 'session' ,
64- started : 1648827162630 ,
65- } ) ;
66- } ) ;
67-
6848it ( 'fetches a session that does not exist' , function ( ) {
69- expect ( fetchSession ( SAMPLE_RATES ) ) . toBe ( null ) ;
49+ expect ( fetchSession ( ) ) . toBe ( null ) ;
7050} ) ;
7151
7252it ( 'fetches an invalid session' , function ( ) {
7353 WINDOW . sessionStorage . setItem ( REPLAY_SESSION_KEY , '{"id":"fd09adfc4117477abc8de643e5a5798a",' ) ;
7454
75- expect ( fetchSession ( SAMPLE_RATES ) ) . toBe ( null ) ;
55+ expect ( fetchSession ( ) ) . toBe ( null ) ;
7656} ) ;
7757
7858it ( 'safely attempts to fetch session when Session Storage is disabled' , function ( ) {
@@ -85,5 +65,5 @@ it('safely attempts to fetch session when Session Storage is disabled', function
8565 } ,
8666 } ) ;
8767
88- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( null ) ;
68+ expect ( fetchSession ( ) ) . toEqual ( null ) ;
8969} ) ;
0 commit comments