-
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 #494 from IQSS/fix-develop-merge
fix: add missing import statement
- Loading branch information
Showing
8 changed files
with
82 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { AccountHelper } from '../../../../src/sections/account/AccountHelper' | ||
|
||
describe('AccountHelper', () => { | ||
describe('defineSelectedTabKey', () => { | ||
it('should return the correct tab key when a tab query param is present in the URL', () => { | ||
const searchParams = new URLSearchParams() | ||
searchParams.set( | ||
AccountHelper.ACCOUNT_PANEL_TAB_QUERY_KEY, | ||
AccountHelper.ACCOUNT_PANEL_TABS_KEYS.notifications | ||
) | ||
|
||
const result = AccountHelper.defineSelectedTabKey(searchParams) | ||
|
||
expect(result).to.equal(AccountHelper.ACCOUNT_PANEL_TABS_KEYS.notifications) | ||
}) | ||
|
||
it('should return the my data tab key as default if the tab query param is not present in the URL', () => { | ||
const searchParams = new URLSearchParams() | ||
|
||
const result = AccountHelper.defineSelectedTabKey(searchParams) | ||
|
||
expect(result).to.equal(AccountHelper.ACCOUNT_PANEL_TABS_KEYS.myData) | ||
}) | ||
}) | ||
}) |
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
24 changes: 24 additions & 0 deletions
24
tests/e2e-integration/e2e/sections/homepage/Homepage.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { QueryParamKey } from '../../../../../src/sections/Route.enum' | ||
|
||
describe('Homepage', () => { | ||
it('should navigate to the collections page with the search value encoded in the URL', () => { | ||
const searchValue = 'John Doe' | ||
cy.visit('/spa/') | ||
cy.get('[aria-label="Search"]').type(searchValue) | ||
cy.get('[aria-label="Submit Search"]').click() | ||
|
||
const encodedSearchValue = encodeURIComponent(searchValue) | ||
|
||
const searchParams = new URLSearchParams() | ||
searchParams.set(QueryParamKey.QUERY, encodedSearchValue) | ||
|
||
cy.url().should('include', `/collections?${searchParams.toString()}`) | ||
}) | ||
|
||
it('navigates directly to the collection page when clicking the Browse Collections button', () => { | ||
cy.visit('/spa/') | ||
cy.findByRole('link', { name: 'Browse Collections' }).click() | ||
|
||
cy.url().should('eq', `${Cypress.config().baseUrl as string}/spa/collections`) | ||
}) | ||
}) |