Skip to content

Commit

Permalink
Merge pull request #874 from dpc-sdp/fix/r20-1553-pagelink-text
Browse files Browse the repository at this point in the history
[R20-1553] Change page link props at mapping
  • Loading branch information
waitingallday authored Oct 3, 2023
2 parents 9db150a + 5d7bbc3 commit e8b484c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Feature: Publication page page
Example: On load
When I visit the page "/demo-publication/demo-publication-chapter-1"
Then the title should be "Demo Publication - Chapter 1"
And there should be a page link with a title of "Previous" and description text of "Demo Publication"
And there should be a page link with a title of "Next" and description text of "Demo Publication - Chapter 1 - Page 1"
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@
],
"pagination": {
"prev": {
"text": "Demo Publication",
"text": "Previous",
"url": "/demo-publication",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus."
"description": "Demo Publication"
},
"next": {
"text": "Demo Publication - Chapter 1 - Page 1",
"text": "Next",
"url": "/demo-publication/demo-publication-chapter-1/demo-publication-chapter-1-page-1",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus."
"description": "Demo Publication - Chapter 1 - Page 1"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Then } from '@badeball/cypress-cucumber-preprocessor'

Then(
'there should be a page link with a title of {string} and description text of {string}',
(title: string, desc: string) => {
cy.get('.rpl-page-links__link-label').contains(title).should('exist')
cy.get('.rpl-page-links__link-text').contains(desc).should('exist')
}
)
10 changes: 4 additions & 6 deletions packages/ripple-tide-publication/mapping/publication-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,14 @@ const tidePublicationPageModule: IRplTideModuleMapping = {
})),
pagination: {
prev: {
label: 'publication_navigation_prev.meta.title',
label: () => 'Previous',
url: 'publication_navigation_prev.meta.url',
description:
'publication_navigation_prev.meta.field_landing_page_summary'
description: 'publication_navigation_prev.meta.title'
},
next: {
label: 'publication_navigation_next.meta.title',
label: () => 'Next',
url: 'publication_navigation_next.meta.url',
description:
'publication_navigation_next.meta.field_landing_page_summary'
description: 'publication_navigation_next.meta.title'
}
}
},
Expand Down

0 comments on commit e8b484c

Please sign in to comment.