@@ -4,30 +4,6 @@ const makeHook = require('../lib/parse-result')
44const parseResult = makeHook ( { fields : [ 'title' , 'description' ] } )
55
66describe ( 'Result' , function ( ) {
7- it ( 'empty description string' , function ( ) {
8- const context = {
9- type : 'after' ,
10- result : {
11- data : [
12- {
13- title : {
14- en : 'another title'
15- } ,
16- description : {
17- en : ''
18- }
19- }
20- ]
21- }
22- }
23-
24- makeHook ( { fields : [ 'title' , 'description' ] , language : 'en' } ) ( context )
25- const { result } = context
26-
27- assert . strictEqual ( result . data [ 0 ] . title , 'another title' , 'we have converted the title' )
28- assert . strictEqual ( result . data [ 0 ] . description , '' , 'we have the correct description' )
29- } )
30-
317 it ( 'transforms the result as object' , function ( ) {
328 const context = {
339 type : 'after' ,
@@ -64,8 +40,8 @@ describe('Result', function () {
6440
6541 parseResult ( context )
6642 const { result } = context
67- assert . strictEqual ( result . data [ 0 ] . title , '' , 'Output not matched !!!! ??? error ' )
68- assert . strictEqual ( result . data [ 0 ] . description , '' , 'Empty str ' )
43+ assert . strictEqual ( result . data [ 0 ] . title , '' , 'Space not parsed correctly ' )
44+ assert . strictEqual ( result . data [ 0 ] . description , '' , 'Space not parsed correctly ' )
6945 } )
7046
7147 it ( 'ignores already transformed result' , function ( ) {
0 commit comments