@@ -15,18 +15,13 @@ afterEach(() => {
15
15
WINDOW . sessionStorage . clear ( ) ;
16
16
} ) ;
17
17
18
- const SAMPLE_RATES = {
19
- sessionSampleRate : 1.0 ,
20
- errorSampleRate : 0.0 ,
21
- } ;
22
-
23
18
it ( 'fetches a valid and sampled session' , function ( ) {
24
19
WINDOW . sessionStorage . setItem (
25
20
REPLAY_SESSION_KEY ,
26
21
'{"id":"fd09adfc4117477abc8de643e5a5798a","sampled": "session","started":1648827162630,"lastActivity":1648827162658}' ,
27
22
) ;
28
23
29
- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( {
24
+ expect ( fetchSession ( ) ) . toEqual ( {
30
25
id : 'fd09adfc4117477abc8de643e5a5798a' ,
31
26
lastActivity : 1648827162658 ,
32
27
segmentId : 0 ,
@@ -41,7 +36,7 @@ it('fetches an unsampled session', function () {
41
36
'{"id":"fd09adfc4117477abc8de643e5a5798a","sampled": false,"started":1648827162630,"lastActivity":1648827162658}' ,
42
37
) ;
43
38
44
- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( {
39
+ expect ( fetchSession ( ) ) . toEqual ( {
45
40
id : 'fd09adfc4117477abc8de643e5a5798a' ,
46
41
lastActivity : 1648827162658 ,
47
42
segmentId : 0 ,
@@ -50,29 +45,14 @@ it('fetches an unsampled session', function () {
50
45
} ) ;
51
46
} ) ;
52
47
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
-
68
48
it ( 'fetches a session that does not exist' , function ( ) {
69
- expect ( fetchSession ( SAMPLE_RATES ) ) . toBe ( null ) ;
49
+ expect ( fetchSession ( ) ) . toBe ( null ) ;
70
50
} ) ;
71
51
72
52
it ( 'fetches an invalid session' , function ( ) {
73
53
WINDOW . sessionStorage . setItem ( REPLAY_SESSION_KEY , '{"id":"fd09adfc4117477abc8de643e5a5798a",' ) ;
74
54
75
- expect ( fetchSession ( SAMPLE_RATES ) ) . toBe ( null ) ;
55
+ expect ( fetchSession ( ) ) . toBe ( null ) ;
76
56
} ) ;
77
57
78
58
it ( '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
85
65
} ,
86
66
} ) ;
87
67
88
- expect ( fetchSession ( SAMPLE_RATES ) ) . toEqual ( null ) ;
68
+ expect ( fetchSession ( ) ) . toEqual ( null ) ;
89
69
} ) ;
0 commit comments