@@ -13,10 +13,10 @@ describe('graph-workspace', () => {
1313
1414 test ( 'returns doc on empty object' , ( ) => {
1515 expect ( migration ( { } as SavedObjectUnsanitizedDoc ) ) . toMatchInlineSnapshot ( `
16- Object {
17- "references": Array [],
18- }
19- ` ) ;
16+ Object {
17+ "references": Array [],
18+ }
19+ `) ;
2020 } ) ;
2121
2222 test ( 'returns doc when wsState is not a string' , ( ) => {
@@ -28,14 +28,15 @@ Object {
2828 } ,
2929 } ;
3030 expect ( migration ( doc ) ) . toMatchInlineSnapshot ( `
31- Object {
32- "attributes": Object {
33- "wsState": true,
34- },
35- "id": "1",
36- "references": Array [],
37- }
38- ` ) ;
31+ Object {
32+ "attributes": Object {
33+ "wsState": true,
34+ },
35+ "id": "1",
36+ "references": Array [],
37+ "type": "graph-workspace",
38+ }
39+ ` ) ;
3940 } ) ;
4041
4142 test ( 'returns doc when wsState is not valid JSON' , ( ) => {
@@ -47,14 +48,15 @@ Object {
4748 } ,
4849 } ;
4950 expect ( migration ( doc ) ) . toMatchInlineSnapshot ( `
50- Object {
51- "attributes": Object {
52- "wsState": "123abc",
53- },
54- "id": "1",
55- "references": Array [],
56- }
57- ` ) ;
51+ Object {
52+ "attributes": Object {
53+ "wsState": "123abc",
54+ },
55+ "id": "1",
56+ "references": Array [],
57+ "type": "graph-workspace",
58+ }
59+ ` ) ;
5860 } ) ;
5961
6062 test ( 'returns doc when "indexPattern" is missing from wsState' , ( ) => {
@@ -66,14 +68,15 @@ Object {
6668 } ,
6769 } ;
6870 expect ( migration ( doc ) ) . toMatchInlineSnapshot ( `
69- Object {
70- "attributes": Object {
71- "wsState": "\\"{\\\\\\"foo\\\\\\":true}\\"",
72- },
73- "id": "1",
74- "references": Array [],
75- }
76- ` ) ;
71+ Object {
72+ "attributes": Object {
73+ "wsState": "\\"{\\\\\\"foo\\\\\\":true}\\"",
74+ },
75+ "id": "1",
76+ "references": Array [],
77+ "type": "graph-workspace",
78+ }
79+ ` ) ;
7780 } ) ;
7881
7982 test ( 'extract "indexPattern" attribute from doc' , ( ) => {
@@ -87,21 +90,22 @@ Object {
8790 } ;
8891 const migratedDoc = migration ( doc ) ;
8992 expect ( migratedDoc ) . toMatchInlineSnapshot ( `
90- Object {
91- "attributes": Object {
92- "bar": true,
93- "wsState": "\\"{\\\\\\"foo\\\\\\":true,\\\\\\"indexPatternRefName\\\\\\":\\\\\\"indexPattern_0\\\\\\"}\\"",
94- },
95- "id": "1",
96- "references": Array [
97- Object {
98- "id": "pattern*",
99- "name": "indexPattern_0",
100- "type": "index-pattern",
101- },
102- ],
103- }
104- ` ) ;
93+ Object {
94+ "attributes": Object {
95+ "bar": true,
96+ "wsState": "\\"{\\\\\\"foo\\\\\\":true,\\\\\\"indexPatternRefName\\\\\\":\\\\\\"indexPattern_0\\\\\\"}\\"",
97+ },
98+ "id": "1",
99+ "references": Array [
100+ Object {
101+ "id": "pattern*",
102+ "name": "indexPattern_0",
103+ "type": "index-pattern",
104+ },
105+ ],
106+ "type": "graph-workspace",
107+ }
108+ ` ) ;
105109 } ) ;
106110 } ) ;
107111} ) ;
0 commit comments