This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: start coverage of core renderer module
Relates to #373
- Loading branch information
1 parent
60a8b90
commit 0199cca
Showing
2 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
import * as Common from './common' | ||
|
||
it('deepResolveInputTypes', () => { | ||
const typeMap: Common.InputTypesMap = { | ||
A: { | ||
name: 'A', | ||
type: { | ||
name: 'A', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
}, | ||
fields: [ | ||
{ | ||
name: 'b', | ||
arguments: [], | ||
type: { | ||
name: 'B', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
isRequired: false, | ||
isArray: false, | ||
}, | ||
}, | ||
{ | ||
name: 'c', | ||
arguments: [], | ||
type: { | ||
name: 'C', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
isRequired: false, | ||
isArray: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
B: { | ||
name: 'B', | ||
type: { | ||
name: 'B', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
}, | ||
fields: [ | ||
{ | ||
name: 'd', | ||
arguments: [], | ||
type: { | ||
name: 'D', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
isRequired: false, | ||
isArray: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
C: { | ||
name: 'C', | ||
type: { | ||
name: 'C', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
}, | ||
fields: [ | ||
{ | ||
name: 'd', | ||
arguments: [], | ||
type: { | ||
name: 'D', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
isRequired: false, | ||
isArray: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
D: { | ||
name: 'D', | ||
type: { | ||
name: 'D', | ||
isInput: true, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: false, | ||
isUnion: false, | ||
}, | ||
fields: [ | ||
{ | ||
name: 'foo', | ||
arguments: [], | ||
type: { | ||
name: 'String', | ||
isInput: false, | ||
isEnum: false, | ||
isInterface: false, | ||
isObject: false, | ||
isScalar: true, | ||
isUnion: false, | ||
isRequired: false, | ||
isArray: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
expect(Common.deepResolveInputTypes(typeMap, 'A')).toMatchInlineSnapshot(` | ||
Array [ | ||
"A", | ||
"B", | ||
"D", | ||
"C", | ||
"D", | ||
] | ||
`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters