@@ -6,21 +6,30 @@ describe('excludeGraphQLFetch', () => {
6
6
excludeGraphQLFetch ( {
7
7
category : 'fetch' ,
8
8
data : { url : 'https://example.com/graphql' } ,
9
- } )
9
+ } ) ,
10
10
) . toBeNull ( ) ;
11
11
} ) ;
12
12
13
+ it ( 'should default to not assuming GraphQL when missing the URL' , ( ) => {
14
+ const breadcrumb = {
15
+ category : 'fetch' ,
16
+ data : { } ,
17
+ } ;
18
+
19
+ expect ( excludeGraphQLFetch ( breadcrumb ) ) . toBe ( breadcrumb ) ;
20
+ } ) ;
21
+
13
22
it ( 'should leave non-GraphQL fetches' , ( ) => {
14
23
const breadcrumb = {
15
24
category : 'fetch' ,
16
25
data : { url : 'https://example.com' } ,
17
26
} ;
18
- expect ( excludeGraphQLFetch ( breadcrumb ) ) . toEqual ( breadcrumb ) ;
27
+ expect ( excludeGraphQLFetch ( breadcrumb ) ) . toBe ( breadcrumb ) ;
19
28
} ) ;
20
29
21
30
it ( 'should leave non-fetch breadcrumbs' , ( ) => {
22
31
const breadcrumb = { category : 'not-fetch' } ;
23
- expect ( excludeGraphQLFetch ( breadcrumb ) ) . toEqual ( breadcrumb ) ;
32
+ expect ( excludeGraphQLFetch ( breadcrumb ) ) . toBe ( breadcrumb ) ;
24
33
} ) ;
25
34
} ) ;
26
35
@@ -34,7 +43,7 @@ describe('withoutGraphQLFetch', () => {
34
43
wrapped ( {
35
44
category : 'fetch' ,
36
45
data : { url : 'https://example.com/graphql' } ,
37
- } )
46
+ } ) ,
38
47
) . toBeNull ( ) ;
39
48
expect ( callback ) . not . toHaveBeenCalled ( ) ;
40
49
} ) ;
@@ -49,7 +58,7 @@ describe('withoutGraphQLFetch', () => {
49
58
50
59
const wrapped = withoutGraphQLFetch ( callback ) ;
51
60
52
- expect ( wrapped ( initial , hint ) ) . toEqual ( altered ) ;
61
+ expect ( wrapped ( initial , hint ) ) . toBe ( altered ) ;
53
62
expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
54
63
expect ( callback ) . toHaveBeenCalledWith ( initial , hint ) ;
55
64
} ) ;
0 commit comments