Skip to content

Commit

Permalink
Slugify Collectives and Pages (try fix cypress)
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
  • Loading branch information
Koc committed Jan 21, 2025
1 parent 090d6f3 commit 9f76e1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions cypress/e2e/pages-links.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*/

const baseUrl = Cypress.env('baseUrl')
const sourceUrl = new URL(`${baseUrl}/index.php/apps/collectives/Link%20Testing/Link%20Source`)
let imageId, pdfId, textId
let anotherCollectiveFirstPageId, linkTargetPageId
let imageId, pdfId, textId, sourceUrl
let anotherCollectiveFirstPageId, anotherCollectiveId, linkTestingCollectiveId, linkTargetPageId

Check failure on line 8 in cypress/e2e/pages-links.spec.js

View workflow job for this annotation

GitHub Actions / NPM lint

'anotherCollectiveId' is assigned a value but never used

Check failure on line 8 in cypress/e2e/pages-links.spec.js

View workflow job for this annotation

GitHub Actions / NPM lint

'linkTestingCollectiveId' is assigned a value but never used

describe('Page link handling', function() {
before(function() {
cy.loginAs('bob')
cy.deleteAndSeedCollective('Another Collective')
.seedPage('First Page', '', 'Readme.md').then(({ pageId }) => {
.seedPage('First Page', '', 'Readme.md').then(({ collectiveId, pageId }) => {
anotherCollectiveId = collectiveId
anotherCollectiveFirstPageId = pageId
})
cy.deleteAndSeedCollective('Link Testing')
Expand All @@ -21,7 +21,10 @@ describe('Page link handling', function() {
.seedPage('Link Target', '', 'Readme.md').then(({ pageId }) => {
linkTargetPageId = pageId
})
.seedPage('Link Source', '', 'Readme.md')
.seedPage('Link Source', '', 'Readme.md').then(({ collectiveId, pageId }) => {
linkTestingCollectiveId = collectiveId
sourceUrl = new URL(`${baseUrl}/index.php/apps/collectives/Link-Testing-${collectiveId}/page-${pageId}-Link-Source`)
})
cy.seedPageContent('Link%20Testing/Link%20Target.md', 'Some content')
cy.uploadFile('test.md', 'text/markdown').then((id) => {
textId = id
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Cypress.Commands.add('seedPage',
)
})
.its('data.data.id')
.then(pageId => ({ ...subject, pageId }))
.then(pageId => ({ ...subject, collectiveId: collectiveContext(subject).collectiveId, pageId }))
})

/**
Expand Down

0 comments on commit 9f76e1b

Please sign in to comment.