Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
213 additions
and
1 deletion.
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
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,59 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationObject from "./navigation.object"; | ||
import schema from "../test/empty.schema.json"; | ||
|
||
describe("pĺugins/navigation.directive#NavigationDirectives", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationObject( | ||
{ | ||
...schema.data.__schema, | ||
types: [], | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}) | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationObject(schema.data.__schema, projectPackage, {}); | ||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Objects", | ||
items: [ | ||
{ | ||
"href": "/directive.spec.html", | ||
"isActive": false, | ||
"text": "__Directive", | ||
}, | ||
{ | ||
"href": "/enumvalue.spec.html", | ||
"isActive": false, | ||
"text": "__EnumValue", | ||
}, | ||
{ | ||
"href": "/field.spec.html", | ||
"isActive": false, | ||
"text": "__Field", | ||
}, | ||
{ | ||
"href": "/inputvalue.spec.html", | ||
"isActive": false, | ||
"text": "__InputValue", | ||
}, | ||
{ | ||
"href": "/schema.spec.html", | ||
"isActive": false, | ||
"text": "__Schema", | ||
}, | ||
{ | ||
"href": "/type.spec.html", | ||
"isActive": false, | ||
"text": "__Type", | ||
}, | ||
] | ||
} | ||
]); | ||
}); | ||
}); |
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,59 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationScalar from "./navigation.object"; | ||
import schema from "../test/empty.schema.json"; | ||
|
||
describe("pĺugins/navigation.directive#NavigationDirectives", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationScalar( | ||
{ | ||
...schema.data.__schema, | ||
types: [], | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}) | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationScalar(schema.data.__schema, projectPackage, {}); | ||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Objects", | ||
items: [ | ||
{ | ||
"href": "/directive.spec.html", | ||
"isActive": false, | ||
"text": "__Directive", | ||
}, | ||
{ | ||
"href": "/enumvalue.spec.html", | ||
"isActive": false, | ||
"text": "__EnumValue", | ||
}, | ||
{ | ||
"href": "/field.spec.html", | ||
"isActive": false, | ||
"text": "__Field", | ||
}, | ||
{ | ||
"href": "/inputvalue.spec.html", | ||
"isActive": false, | ||
"text": "__InputValue", | ||
}, | ||
{ | ||
"href": "/schema.spec.html", | ||
"isActive": false, | ||
"text": "__Schema", | ||
}, | ||
{ | ||
"href": "/type.spec.html", | ||
"isActive": false, | ||
"text": "__Type", | ||
}, | ||
] | ||
} | ||
]); | ||
}); | ||
}); |
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,36 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationSchema from "./navigation.schema"; | ||
import schema from "../test/empty.schema.json"; | ||
|
||
describe("pĺugins/navigation.directive#NavigationDirectives", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationSchema( | ||
{ | ||
...schema.data.__schema, | ||
mutationType: null, | ||
queryType: null, | ||
subscriptionType: null | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}) | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationSchema(schema.data.__schema, projectPackage, {}); | ||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Schema", | ||
items: [ | ||
{ | ||
"href": "/query.doc.html", | ||
"isActive": true, | ||
"text": "Query" | ||
} | ||
] | ||
} | ||
]); | ||
}); | ||
}); |
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
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,49 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationUnion from "./navigation.union"; | ||
import schema from "../test/github.json"; | ||
|
||
describe("pĺugins/navigation.directive#NavigationDirectives", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationUnion( | ||
{ | ||
...schema.data.__schema, | ||
types: [], | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}) | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationUnion(schema.data.__schema, projectPackage, {}); | ||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Unions", | ||
items: [ | ||
{ | ||
"href": "/issuetimelineitem.doc.html", | ||
"isActive": false, | ||
"text": "IssueTimelineItem", | ||
}, | ||
{ | ||
"href": "/projectcarditem.doc.html", | ||
"isActive": false, | ||
"text": "ProjectCardItem", | ||
}, | ||
{ | ||
"href": "/reviewdismissalallowanceactor.doc.html", | ||
"isActive": false, | ||
"text": "ReviewDismissalAllowanceActor", | ||
}, | ||
{ | ||
"href": "/searchresultitem.doc.html", | ||
"isActive": false, | ||
"text": "SearchResultItem", | ||
}, | ||
] | ||
} | ||
]); | ||
}); | ||
}); |