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
9 changed files
with
181 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...ins/__test__/navigation.directive.test.ts → plugins/navigation.directive.test.ts
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,35 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationEnums from "./navigation.enum"; | ||
import schema from "../test/empty.schema.json"; | ||
|
||
describe("pĺugins/navigation.directive#NavigationDirectives", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationEnums( | ||
{ | ||
...schema.data.__schema, | ||
types: [], | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}) | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationEnums(schema.data.__schema, projectPackage, {}); | ||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Enums", | ||
items: [ | ||
{ | ||
text: "__DirectiveLocation", | ||
href: "/directivelocation.spec.html", | ||
isActive: false | ||
}, | ||
{ text: "__TypeKind", href: "/typekind.spec.html", isActive: false } | ||
] | ||
} | ||
]); | ||
}); | ||
}); |
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,34 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationInputs from "./navigation.input"; | ||
import schema from "../test/empty.schema.json"; | ||
|
||
describe("pĺugins/navigation.directive#NavigationDirectives", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationInputs( | ||
{ | ||
...schema.data.__schema, | ||
types: [], | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}) | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationInputs(schema.data.__schema, projectPackage, {}); | ||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Input Objects", | ||
items: [ | ||
{ | ||
text: "AddCommentInput", | ||
href: "/addcommentinput.doc.html", | ||
isActive: false | ||
} | ||
] | ||
} | ||
]); | ||
}); | ||
}); |
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,109 @@ | ||
import projectPackage from "../test/empty.package.json"; | ||
import NavigationInterfaces from "./navigation.interface"; | ||
import schema from "../test/github.json"; | ||
|
||
describe("pĺugins/navigation.interface#NavigationInterfaces", () => { | ||
test("plugin return empty", () => { | ||
const plugin = new NavigationInterfaces( | ||
{ | ||
...schema.data.__schema, | ||
types: [], | ||
}, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([]) | ||
}); | ||
|
||
test("plugin return navigation", () => { | ||
const plugin = new NavigationInterfaces( | ||
schema.data.__schema, | ||
projectPackage, | ||
{} | ||
); | ||
|
||
expect(plugin.getNavigations("Query")).toEqual([ | ||
{ | ||
title: "Interfaces", | ||
items: [ | ||
{ | ||
"href": "/author.doc.html", | ||
"isActive": false, | ||
"text": "Author", | ||
}, | ||
{ | ||
"href": "/comment.doc.html", | ||
"isActive": false, | ||
"text": "Comment", | ||
}, | ||
{ | ||
"href": "/gitobject.doc.html", | ||
"isActive": false, | ||
"text": "GitObject", | ||
}, | ||
{ | ||
"href": "/gitsignature.doc.html", | ||
"isActive": false, | ||
"text": "GitSignature", | ||
}, | ||
{ | ||
"href": "/issueevent.doc.html", | ||
"isActive": false, | ||
"text": "IssueEvent", | ||
}, | ||
{ | ||
"href": "/issueish.doc.html", | ||
"isActive": false, | ||
"text": "Issueish", | ||
}, | ||
{ | ||
"href": "/node.doc.html", | ||
"isActive": false, | ||
"text": "Node", | ||
}, | ||
{ | ||
"href": "/projectowner.doc.html", | ||
"isActive": false, | ||
"text": "ProjectOwner", | ||
}, | ||
{ | ||
"href": "/reactable.doc.html", | ||
"isActive": false, | ||
"text": "Reactable", | ||
}, | ||
{ | ||
"href": "/repositoryinfo.doc.html", | ||
"isActive": false, | ||
"text": "RepositoryInfo", | ||
}, | ||
{ | ||
"href": "/repositorynode.doc.html", | ||
"isActive": false, | ||
"text": "RepositoryNode", | ||
}, | ||
{ | ||
"href": "/repositoryowner.doc.html", | ||
"isActive": false, | ||
"text": "RepositoryOwner", | ||
}, | ||
{ | ||
"href": "/subscribable.doc.html", | ||
"isActive": false, | ||
"text": "Subscribable", | ||
}, | ||
{ | ||
"href": "/timeline.doc.html", | ||
"isActive": false, | ||
"text": "Timeline", | ||
}, | ||
{ | ||
"href": "/uniformresourcelocatable.doc.html", | ||
"isActive": false, | ||
"text": "UniformResourceLocatable", | ||
}, | ||
] | ||
} | ||
]); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.