Skip to content

Commit

Permalink
TECH-1201 add moveNode util function (#32)
Browse files Browse the repository at this point in the history
* add moveNode util function

* lint --fix
  • Loading branch information
Janin-Michel-Mathias authored Apr 19, 2023
1 parent fc89284 commit c1c3cc2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions fixtures/graphql/jcr/mutation/moveNode.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation($pathOrId: String!, $destParentPathOrId: String!, $destName: String){
jcr{
moveNode(pathOrId: $pathOrId, destParentPathOrId: $destParentPathOrId, destName: $destName){
uuid
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jahia/cypress",
"version": "3.6.0",
"version": "3.7.0",
"scripts": {
"build": "tsc",
"lint": "eslint src -c .eslintrc.json --ext .ts"
Expand Down
11 changes: 11 additions & 0 deletions src/utils/JCRHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ export const getNodeByPath = (path: string, properties?: string[], language?:str
queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
});
};

export const moveNode = (pathOrId: string, destParentPathOrId: string, destName?: string): Cypress.Chainable => {
return cy.apollo({
variables: {
pathOrId: pathOrId,
destParentPathOrId: destParentPathOrId,
destName: destName
},
mutationFile: 'graphql/jcr/mutation/moveNode.graphql'
});
};

0 comments on commit c1c3cc2

Please sign in to comment.