Skip to content

Commit

Permalink
app-project: add /projects to useProjectNavigation external links (#6342
Browse files Browse the repository at this point in the history
)

* add /projects to useProjectNavigation external links
* Fix tests for DropdownNav, Nav, and ProjectHeader.

---------

Co-authored-by: kieftrav <[email protected]>
  • Loading branch information
goplayoutside3 and kieftrav authored Sep 26, 2024
1 parent a240e57 commit 79c80fa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Component > ProjectHeader', function () {
expect(navLinks.length).to.be.above(0)
expect(navLinks[0].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/about/research')
expect(navLinks[navLinks.length - 1].href).to.equal(
'https://localhost/zooniverse/snapshot-serengeti/collections'
'https://localhost/projects/zooniverse/snapshot-serengeti/collections'
)
})
})
Expand All @@ -95,7 +95,7 @@ describe('Component > ProjectHeader', function () {

expect(navLinks.length).to.be.above(0)
expect(navLinks[0].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/about/research')
expect(navLinks[navLinks.length - 1].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/recents')
expect(navLinks[navLinks.length - 1].href).to.equal('https://localhost/projects/zooniverse/snapshot-serengeti/recents')
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Component > ProjectHeader > Dropdown Nav', function () {
expect(navLinks.length).to.be.above(0)
expect(navLinks[0].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/about/research')
expect(navLinks[navLinks.length - 1].href).to.equal(
'https://localhost/zooniverse/snapshot-serengeti/collections'
'https://localhost/projects/zooniverse/snapshot-serengeti/collections'
)
})
})
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Component > ProjectHeader > Dropdown Nav', function () {
const navLinks = within(navMenu).getAllByRole('link')
expect(navLinks.length).to.be.above(0)
expect(navLinks[0].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/about/research')
expect(navLinks[navLinks.length - 1].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/recents')
expect(navLinks[navLinks.length - 1].href).to.equal('https://localhost/projects/zooniverse/snapshot-serengeti/recents')
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Component > ProjectHeader > Nav', function () {
expect(navLinks.length).to.be.above(0)
expect(navLinks[0].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/about/research')
expect(navLinks[navLinks.length - 1].href).to.equal(
'https://localhost/zooniverse/snapshot-serengeti/collections'
'https://localhost/projects/zooniverse/snapshot-serengeti/collections'
)
})
})
Expand All @@ -60,7 +60,7 @@ describe('Component > ProjectHeader > Nav', function () {
const navLinks = within(navMenu).getAllByRole('link')
expect(navLinks.length).to.be.above(0)
expect(navLinks[0].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/about/research')
expect(navLinks[navLinks.length - 1].href).to.equal('https://localhost/zooniverse/snapshot-serengeti/recents')
expect(navLinks[navLinks.length - 1].href).to.equal('https://localhost/projects/zooniverse/snapshot-serengeti/recents')
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ export default function useProjectNavigation(adminMode) {
text: t('ProjectHeader.classify')
},
{
href: `/${slug}/talk`,
href: `/projects/${slug}/talk`,
text: t('ProjectHeader.talk'),
externalLink: true // code is in PFE
},
{
href: `/${slug}/collections`,
href: `/projects/${slug}/collections`,
text: t('ProjectHeader.collect'),
externalLink: true // code is in PFE
}
]

if (isLoggedIn) {
links.push({
href: `/${slug}/recents`,
href: `/projects/${slug}/recents`,
text: t('ProjectHeader.recents'),
externalLink: true // code is in PFE
})
Expand Down

0 comments on commit 79c80fa

Please sign in to comment.