Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TECH-654 - added workspace argument to deleteNode #73

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fixtures/graphql/jcr/mutation/deleteNode.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mutation deleteNode($pathOrId: String!) {
jcr(workspace: EDIT) {
mutation deleteNode($pathOrId: String!, $workspace: Workspace!) {
jcr(workspace: $workspace) {
deleteNode(pathOrId: $pathOrId)
}
}
9 changes: 6 additions & 3 deletions src/utils/JCRHelper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
type Workspace = 'EDIT' | 'LIVE';

export const setNodeProperty = (pathOrId: string, property: string, value: string | Array<string>, language: string): Cypress.Chainable => {
let mutationFile = 'graphql/jcr/mutation/setProperty.graphql';
if (value instanceof Array) {
Expand All @@ -15,10 +17,11 @@
});
};

export const deleteNode = (pathOrId: string): Cypress.Chainable => {
export const deleteNode = (pathOrId: string, workspace: Workspace = 'EDIT'): Cypress.Chainable => {
return cy.apollo({
variables: {
pathOrId: pathOrId
pathOrId: pathOrId,
workspace
},
mutationFile: 'graphql/jcr/mutation/deleteNode.graphql'
});
Expand All @@ -43,7 +46,7 @@
});
};

export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace: 'EDIT' | 'LIVE' = 'EDIT'): Cypress.Chainable => {
export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace: Workspace = 'EDIT'): Cypress.Chainable => {

Check warning on line 49 in src/utils/JCRHelper.ts

View workflow job for this annotation

GitHub Actions / Lint and build

Arrow function has too many parameters (5). Maximum allowed is 4
return cy.apollo({
variables: {
path: path,
Expand Down
Loading