Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Aug 11, 2024
1 parent 2b84f6c commit ffee87b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 45 deletions.
79 changes: 46 additions & 33 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/graph.diagnostic.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# Graph

npm run -s transmute -- graph assist ./tests/fixtures/issuer-claims.json --credential-type application/vc --output ./tests/fixtures/issuer-claims.graph.json
npm run -s transmute -- graph assist ./tests/fixtures/issuer-claims.json --credential-type application/vc --output ./tests/fixtures/issuer-claims.graph.json --env ./.env --push
6 changes: 4 additions & 2 deletions src/graph/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const handler = async function ({ positionals, values }: Arguments) {
})
const { items } = await getPresentations({ sent: true, received: true, api })
const d = await driver()
const session = d.session()
for (const item of items) {
try {
const content = encoder.encode(item.content)
Expand All @@ -56,8 +57,9 @@ export const handler = async function ({ positionals, values }: Arguments) {
const message = `\n${dangerousQuery}\n`
console.log(message)
}
const session = d.session()
await push(session, components)
if (values.push) {
await push(session, components)
}
} catch (e) {
if (verbose) {
const message = `⛔ ${item.id}`
Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/issuer-claims.graph.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"nodes": {
"_:uajkGhlO24W-VBNrTqqmRIbZajtDhjrNy5k2tcLu--Xg": {
"id": "_:uajkGhlO24W-VBNrTqqmRIbZajtDhjrNy5k2tcLu--Xg",
"_:uPmcijy64rqhKcJrEu2pVmxxYJsXucSSv3HNxJxfFc1Y": {
"id": "_:uPmcijy64rqhKcJrEu2pVmxxYJsXucSSv3HNxJxfFc1Y",
"labels": [
"https://www.w3.org/2018/credentials#VerifiableCredential",
"https://www.w3.org/ns/credentials/examples#MyPrototypeCredential"
]
},
"_:ue-Mg0kAOs7IlvPKKpjBOQ4JF6Y2GFU2LLwLiG8qJJwI": {
"id": "_:ue-Mg0kAOs7IlvPKKpjBOQ4JF6Y2GFU2LLwLiG8qJJwI",
"_:uQO_zbFsurclUMl-TDuyJ33daQ59_j7gVaBmwBDDAVtE": {
"id": "_:uQO_zbFsurclUMl-TDuyJ33daQ59_j7gVaBmwBDDAVtE",
"labels": [
"https://www.w3.org/2018/credentials#credentialSubject"
],
Expand All @@ -17,9 +17,9 @@
},
"edges": [
{
"source": "_:uajkGhlO24W-VBNrTqqmRIbZajtDhjrNy5k2tcLu--Xg",
"source": "_:uPmcijy64rqhKcJrEu2pVmxxYJsXucSSv3HNxJxfFc1Y",
"label": "credentialSubject",
"target": "_:ue-Mg0kAOs7IlvPKKpjBOQ4JF6Y2GFU2LLwLiG8qJJwI",
"target": "_:uQO_zbFsurclUMl-TDuyJ33daQ59_j7gVaBmwBDDAVtE",
"predicate": "https://www.w3.org/2018/credentials#credentialSubject"
}
]
Expand Down
6 changes: 3 additions & 3 deletions tests/graph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ it.skip('graph assist gql', async () => {
expect(output).toHaveBeenCalledTimes(1)
})

it.skip('graph assist gql neo4j', async () => {
await facade(`graph assist ./tests/fixtures/issuer-claims.json --verbose --credential-type application/vc --graph-type application/gql --push`)
it.skip('graph assist credential', async () => {
await facade(`graph assist ./tests/fixtures/issuer-claims.json --verbose --credential-type application/vc --graph-type application/gql --push --env ./.env`)
expect(debug).toHaveBeenCalledTimes(1)
expect(output).toHaveBeenCalledTimes(1)
})

it.skip('graph assist vdp', async () => {
it.skip('graph assist presentation', async () => {
await facade(`graph assist --verbose --credential-type application/vc --graph-type application/gql --push --env ./.env`)
expect(debug).toHaveBeenCalledTimes(1)
expect(output).toHaveBeenCalledTimes(1)
Expand Down

0 comments on commit ffee87b

Please sign in to comment.