-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #453 from IQSS/feat/437-collection-page-url
437 - Collection page url
- Loading branch information
Showing
14 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
tests/component/sections/shared/link-to-page/LinkToPage.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
import { LinkToPage } from '../../../../../src/sections/shared/link-to-page/LinkToPage' | ||
import { Route } from '../../../../../src/sections/Route.enum' | ||
import { DvObjectType } from '../../../../../src/shared/hierarchy/domain/models/UpwardHierarchyNode' | ||
|
||
describe('LinkToPage', () => { | ||
it('renders a link to the page with the given search params', () => { | ||
cy.customMount(<LinkToPage page={Route.DATASETS} searchParams={{ foo: 'bar' }} />) | ||
cy.customMount( | ||
<LinkToPage page={Route.DATASETS} type={DvObjectType.DATASET} searchParams={{ foo: 'bar' }} /> | ||
) | ||
cy.findByRole('link').should('have.attr', 'href', '/datasets?foo=bar') | ||
}) | ||
|
||
it('renders a link to the page without search params', () => { | ||
cy.customMount(<LinkToPage page={Route.DATASETS} />) | ||
cy.customMount(<LinkToPage page={Route.DATASETS} type={DvObjectType.DATASET} />) | ||
cy.findByRole('link').should('have.attr', 'href', '/datasets') | ||
}) | ||
|
||
it('renders a link to the collection page with the given id', () => { | ||
cy.customMount( | ||
<LinkToPage | ||
page={Route.COLLECTIONS} | ||
searchParams={{ id: 'collection1' }} | ||
type={DvObjectType.COLLECTION} | ||
/> | ||
) | ||
cy.findByRole('link').should('have.attr', 'href', '/collections/collection1') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters