@@ -92,6 +92,12 @@ test("scoreItem", () => {
9292 ) ;
9393 expect ( pathIdentity . rawValueMatch ) . toBeUndefined ( ) ;
9494 expect ( pathIdentity . formattedValueMatch ) . toBeUndefined ( ) ;
95+ expect ( pathIdentity . label ) . toBe ( "someKey123" ) ;
96+ expect ( pathIdentity . description ) . toBe ( "xyz.some.path" ) ;
97+ expect ( pathIdentity . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
98+ expect ( pathIdentity . formattedValue ) . toBe (
99+ "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ,
100+ ) ;
95101
96102 const labelPrefix = scoreItem ( jsonPath , "som" , true , jsonHeroPathAccessor ) ;
97103 expect ( labelPrefix . score ) . toBeGreaterThan ( 0 ) ;
@@ -101,6 +107,12 @@ test("scoreItem", () => {
101107 expect ( labelPrefix . labelMatch ?. length ) . toBe ( 1 ) ;
102108 expect ( labelPrefix . labelMatch ?. [ 0 ] . start ) . toBe ( 0 ) ;
103109 expect ( labelPrefix . labelMatch ?. [ 0 ] . end ) . toBe ( "som" . length ) ;
110+ expect ( labelPrefix . label ) . toBe ( "someKey123" ) ;
111+ expect ( labelPrefix . description ) . toBe ( "xyz.some.path" ) ;
112+ expect ( labelPrefix . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
113+ expect ( labelPrefix . formattedValue ) . toBe (
114+ "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ,
115+ ) ;
104116
105117 const labelCamelcase = scoreItem ( jsonPath , "sK" , true , jsonHeroPathAccessor ) ;
106118 expect ( labelCamelcase . score ) . toBeGreaterThan ( 0 ) ;
@@ -112,6 +124,12 @@ test("scoreItem", () => {
112124 expect ( labelCamelcase . labelMatch ?. [ 0 ] . end ) . toBe ( 1 ) ;
113125 expect ( labelCamelcase . labelMatch ?. [ 1 ] . start ) . toBe ( 4 ) ;
114126 expect ( labelCamelcase . labelMatch ?. [ 1 ] . end ) . toBe ( 5 ) ;
127+ expect ( labelCamelcase . label ) . toBe ( "someKey123" ) ;
128+ expect ( labelCamelcase . description ) . toBe ( "xyz.some.path" ) ;
129+ expect ( labelCamelcase . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
130+ expect ( labelCamelcase . formattedValue ) . toBe (
131+ "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ,
132+ ) ;
115133
116134 const labelMatch = scoreItem ( jsonPath , "ok" , true , jsonHeroPathAccessor ) ;
117135 expect ( labelMatch . score ) . toBeGreaterThan ( 0 ) ;
@@ -123,6 +141,10 @@ test("scoreItem", () => {
123141 expect ( labelMatch . labelMatch ?. [ 0 ] . end ) . toBe ( 2 ) ;
124142 expect ( labelMatch . labelMatch ?. [ 1 ] . start ) . toBe ( 4 ) ;
125143 expect ( labelMatch . labelMatch ?. [ 1 ] . end ) . toBe ( 5 ) ;
144+ expect ( labelMatch . label ) . toBe ( "someKey123" ) ;
145+ expect ( labelMatch . description ) . toBe ( "xyz.some.path" ) ;
146+ expect ( labelMatch . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
147+ expect ( labelMatch . formattedValue ) . toBe ( "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ) ;
126148
127149 const pathMatch = scoreItem ( jsonPath , "xyz123" , true , jsonHeroPathAccessor ) ;
128150 expect ( pathMatch . score ) . toBeGreaterThan ( 0 ) ;
@@ -133,6 +155,10 @@ test("scoreItem", () => {
133155 expect ( pathMatch . labelMatch ?. length ) . toBe ( 1 ) ;
134156 expect ( pathMatch . labelMatch ?. [ 0 ] . start ) . toBe ( 7 ) ;
135157 expect ( pathMatch . labelMatch ?. [ 0 ] . end ) . toBe ( 10 ) ;
158+ expect ( pathMatch . label ) . toBe ( "someKey123" ) ;
159+ expect ( pathMatch . description ) . toBe ( "xyz.some.path" ) ;
160+ expect ( pathMatch . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
161+ expect ( pathMatch . formattedValue ) . toBe ( "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ) ;
136162
137163 const rawValueMatch = scoreItem ( jsonPath , "-" , true , jsonHeroPathAccessor ) ;
138164 expect ( rawValueMatch . score ) . toBeGreaterThan ( 0 ) ;
@@ -143,6 +169,12 @@ test("scoreItem", () => {
143169 expect ( rawValueMatch . rawValueMatch ?. length ) . toBe ( 1 ) ;
144170 expect ( rawValueMatch . rawValueMatch ?. [ 0 ] . start ) . toBe ( 7 ) ;
145171 expect ( rawValueMatch . rawValueMatch ?. [ 0 ] . end ) . toBe ( 8 ) ;
172+ expect ( rawValueMatch . label ) . toBe ( "someKey123" ) ;
173+ expect ( rawValueMatch . description ) . toBe ( "xyz.some.path" ) ;
174+ expect ( rawValueMatch . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
175+ expect ( rawValueMatch . formattedValue ) . toBe (
176+ "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ,
177+ ) ;
146178
147179 const formattedValueMatch = scoreItem ( jsonPath , "wich" , true , jsonHeroPathAccessor ) ;
148180 expect ( formattedValueMatch . score ) . toBeGreaterThan ( 0 ) ;
@@ -153,6 +185,12 @@ test("scoreItem", () => {
153185 expect ( formattedValueMatch . formattedValueMatch ?. length ) . toBe ( 1 ) ;
154186 expect ( formattedValueMatch . formattedValueMatch ?. [ 0 ] . start ) . toBe ( 40 ) ;
155187 expect ( formattedValueMatch . formattedValueMatch ?. [ 0 ] . end ) . toBe ( 44 ) ;
188+ expect ( formattedValueMatch . label ) . toBe ( "someKey123" ) ;
189+ expect ( formattedValueMatch . description ) . toBe ( "xyz.some.path" ) ;
190+ expect ( formattedValueMatch . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
191+ expect ( formattedValueMatch . formattedValue ) . toBe (
192+ "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ,
193+ ) ;
156194
157195 const valueMatch = scoreItem ( jsonPath , "2022" , true , jsonHeroPathAccessor ) ;
158196 expect ( valueMatch . score ) . toBeGreaterThan ( 0 ) ;
@@ -166,6 +204,10 @@ test("scoreItem", () => {
166204 expect ( valueMatch . formattedValueMatch ?. length ) . toBe ( 1 ) ;
167205 expect ( valueMatch . formattedValueMatch ?. [ 0 ] . start ) . toBe ( 11 ) ;
168206 expect ( valueMatch . formattedValueMatch ?. [ 0 ] . end ) . toBe ( 15 ) ;
207+ expect ( valueMatch . label ) . toBe ( "someKey123" ) ;
208+ expect ( valueMatch . description ) . toBe ( "xyz.some.path" ) ;
209+ expect ( valueMatch . rawValue ) . toBe ( "2022-01-01T00:00:00.000Z" ) ;
210+ expect ( valueMatch . formattedValue ) . toBe ( "Sat Jan 01 2022 00:00:00 GMT+0000 (Greenwich Mean Time)" ) ;
169211
170212 // No Match
171213 const noMatch = scoreItem ( jsonPath , "987" , true , jsonHeroPathAccessor ) ;
0 commit comments