@@ -58,6 +58,30 @@ describe('given the dkim result object', () => {
5858 guidanceTagConnection . connectionType ,
5959 )
6060 } )
61+ it ( 'has a negativeGuidanceTags field' , ( ) => {
62+ const demoType = dkimResultType . getFields ( )
63+
64+ expect ( demoType ) . toHaveProperty ( 'negativeGuidanceTags' )
65+ expect ( demoType . negativeGuidanceTags . type ) . toEqual (
66+ guidanceTagConnection . connectionType ,
67+ )
68+ } )
69+ it ( 'has a neutralGuidanceTags field' , ( ) => {
70+ const demoType = dkimResultType . getFields ( )
71+
72+ expect ( demoType ) . toHaveProperty ( 'neutralGuidanceTags' )
73+ expect ( demoType . neutralGuidanceTags . type ) . toEqual (
74+ guidanceTagConnection . connectionType ,
75+ )
76+ } )
77+ it ( 'has a positiveGuidanceTags field' , ( ) => {
78+ const demoType = dkimResultType . getFields ( )
79+
80+ expect ( demoType ) . toHaveProperty ( 'positiveGuidanceTags' )
81+ expect ( demoType . positiveGuidanceTags . type ) . toEqual (
82+ guidanceTagConnection . connectionType ,
83+ )
84+ } )
6185 } )
6286 describe ( 'testing its field resolvers' , ( ) => {
6387 let query , drop , truncate , migrate , collections , dkim , dkimResult , dkimGT
@@ -79,6 +103,9 @@ describe('given the dkim result object', () => {
79103 record : 'txtRecord' ,
80104 keyLength : '2048' ,
81105 guidanceTags : [ 'dkim1' ] ,
106+ negativeTags : [ 'dkim1' ] ,
107+ neutralTags : [ 'dkim1' ] ,
108+ positiveTags : [ 'dkim1' ] ,
82109 } )
83110 await collections . dkimToDkimResults . save ( {
84111 _to : dkimResult . _id ,
@@ -234,5 +261,179 @@ describe('given the dkim result object', () => {
234261 ) . toEqual ( expectedResult )
235262 } )
236263 } )
264+ describe ( 'testing the negativeGuidanceTags resolver' , ( ) => {
265+ it ( 'returns the resolved value' , async ( ) => {
266+ const demoType = dkimResultType . getFields ( )
267+
268+ const loader = dkimGuidanceTagConnectionsLoader (
269+ query ,
270+ '1' ,
271+ cleanseInput ,
272+ { } ,
273+ )
274+ const negativeTags = [ 'dkim1' ]
275+
276+ const expectedResult = {
277+ edges : [
278+ {
279+ cursor : toGlobalId ( 'guidanceTags' , dkimGT . _key ) ,
280+ node : {
281+ _id : dkimGT . _id ,
282+ _key : dkimGT . _key ,
283+ _rev : dkimGT . _rev ,
284+ _type : 'guidanceTag' ,
285+ guidance : 'Some Interesting Guidance' ,
286+ id : 'dkim1' ,
287+ refLinksGuide : [
288+ {
289+ description : 'refLinksGuide Description' ,
290+ ref_link : 'www.refLinksGuide.ca' ,
291+ } ,
292+ ] ,
293+ refLinksTechnical : [
294+ {
295+ description : 'refLinksTechnical Description' ,
296+ ref_link : 'www.refLinksTechnical.ca' ,
297+ } ,
298+ ] ,
299+ tagId : 'dkim1' ,
300+ tagName : 'DKIM-TAG' ,
301+ } ,
302+ } ,
303+ ] ,
304+ totalCount : 1 ,
305+ pageInfo : {
306+ hasNextPage : false ,
307+ hasPreviousPage : false ,
308+ startCursor : toGlobalId ( 'guidanceTags' , 'dkim1' ) ,
309+ endCursor : toGlobalId ( 'guidanceTags' , 'dkim1' ) ,
310+ } ,
311+ }
312+
313+ expect (
314+ await demoType . negativeGuidanceTags . resolve (
315+ { negativeTags } ,
316+ { first : 1 } ,
317+ { loaders : { dkimGuidanceTagConnectionsLoader : loader } } ,
318+ ) ,
319+ ) . toEqual ( expectedResult )
320+ } )
321+ } )
322+ describe ( 'testing the neutralGuidanceTags resolver' , ( ) => {
323+ it ( 'returns the resolved value' , async ( ) => {
324+ const demoType = dkimResultType . getFields ( )
325+
326+ const loader = dkimGuidanceTagConnectionsLoader (
327+ query ,
328+ '1' ,
329+ cleanseInput ,
330+ { } ,
331+ )
332+ const neutralTags = [ 'dkim1' ]
333+
334+ const expectedResult = {
335+ edges : [
336+ {
337+ cursor : toGlobalId ( 'guidanceTags' , dkimGT . _key ) ,
338+ node : {
339+ _id : dkimGT . _id ,
340+ _key : dkimGT . _key ,
341+ _rev : dkimGT . _rev ,
342+ _type : 'guidanceTag' ,
343+ guidance : 'Some Interesting Guidance' ,
344+ id : 'dkim1' ,
345+ refLinksGuide : [
346+ {
347+ description : 'refLinksGuide Description' ,
348+ ref_link : 'www.refLinksGuide.ca' ,
349+ } ,
350+ ] ,
351+ refLinksTechnical : [
352+ {
353+ description : 'refLinksTechnical Description' ,
354+ ref_link : 'www.refLinksTechnical.ca' ,
355+ } ,
356+ ] ,
357+ tagId : 'dkim1' ,
358+ tagName : 'DKIM-TAG' ,
359+ } ,
360+ } ,
361+ ] ,
362+ totalCount : 1 ,
363+ pageInfo : {
364+ hasNextPage : false ,
365+ hasPreviousPage : false ,
366+ startCursor : toGlobalId ( 'guidanceTags' , 'dkim1' ) ,
367+ endCursor : toGlobalId ( 'guidanceTags' , 'dkim1' ) ,
368+ } ,
369+ }
370+
371+ expect (
372+ await demoType . neutralGuidanceTags . resolve (
373+ { neutralTags } ,
374+ { first : 1 } ,
375+ { loaders : { dkimGuidanceTagConnectionsLoader : loader } } ,
376+ ) ,
377+ ) . toEqual ( expectedResult )
378+ } )
379+ } )
380+ describe ( 'testing the positiveGuidanceTags resolver' , ( ) => {
381+ it ( 'returns the resolved value' , async ( ) => {
382+ const demoType = dkimResultType . getFields ( )
383+
384+ const loader = dkimGuidanceTagConnectionsLoader (
385+ query ,
386+ '1' ,
387+ cleanseInput ,
388+ { } ,
389+ )
390+ const positiveTags = [ 'dkim1' ]
391+
392+ const expectedResult = {
393+ edges : [
394+ {
395+ cursor : toGlobalId ( 'guidanceTags' , dkimGT . _key ) ,
396+ node : {
397+ _id : dkimGT . _id ,
398+ _key : dkimGT . _key ,
399+ _rev : dkimGT . _rev ,
400+ _type : 'guidanceTag' ,
401+ guidance : 'Some Interesting Guidance' ,
402+ id : 'dkim1' ,
403+ refLinksGuide : [
404+ {
405+ description : 'refLinksGuide Description' ,
406+ ref_link : 'www.refLinksGuide.ca' ,
407+ } ,
408+ ] ,
409+ refLinksTechnical : [
410+ {
411+ description : 'refLinksTechnical Description' ,
412+ ref_link : 'www.refLinksTechnical.ca' ,
413+ } ,
414+ ] ,
415+ tagId : 'dkim1' ,
416+ tagName : 'DKIM-TAG' ,
417+ } ,
418+ } ,
419+ ] ,
420+ totalCount : 1 ,
421+ pageInfo : {
422+ hasNextPage : false ,
423+ hasPreviousPage : false ,
424+ startCursor : toGlobalId ( 'guidanceTags' , 'dkim1' ) ,
425+ endCursor : toGlobalId ( 'guidanceTags' , 'dkim1' ) ,
426+ } ,
427+ }
428+
429+ expect (
430+ await demoType . positiveGuidanceTags . resolve (
431+ { positiveTags } ,
432+ { first : 1 } ,
433+ { loaders : { dkimGuidanceTagConnectionsLoader : loader } } ,
434+ ) ,
435+ ) . toEqual ( expectedResult )
436+ } )
437+ } )
237438 } )
238439} )
0 commit comments