-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/IABTechLab/uid2-self-serve-…
…portal into ajy-UID2-4005-Change-several-user-routes-to-accept-participantId # Conflicts: # src/web/components/TeamMember/TeamMember.tsx
- Loading branch information
Showing
11 changed files
with
67 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
import { composeStories } from '@storybook/react'; | ||
import { render, screen, within } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
import * as stories from './PortalHeader.stories'; | ||
|
||
const { ValidEmailAddress, InvalidEmailAddress, NoEmailAddress } = composeStories(stories); | ||
const { InvalidEmailAddress, NoEmailAddress } = composeStories(stories); | ||
|
||
test('when the drop is clicked, a gravatar is displayed', async () => { | ||
const user = userEvent.setup(); | ||
render(<ValidEmailAddress />); | ||
const button = screen.getByRole('button'); | ||
await user.click(button); | ||
const menu = screen.getByRole('menu'); | ||
const avatar = within(menu).getByRole('img'); | ||
expect(avatar).toHaveAttribute('src', expect.stringContaining('//www.gravatar.com/avatar/')); | ||
}); | ||
|
||
test('when an invalid email address is provided, a home link is still displayed', async () => { | ||
render(<InvalidEmailAddress />); | ||
const link = screen.getByRole('link'); | ||
expect(link).toHaveAttribute('href', expect.stringContaining('/home')); | ||
}); | ||
describe('Portal Header tests', () => { | ||
test('when an invalid email address is provided, a home link is still displayed', async () => { | ||
render(<InvalidEmailAddress />); | ||
const link = screen.getByRole('link'); | ||
expect(link).toHaveAttribute('href', expect.stringContaining('/home')); | ||
}); | ||
|
||
test('when no email is provided, the dropdown text shows that there is no logged in user', async () => { | ||
render(<NoEmailAddress />); | ||
const button = screen.getByRole('button'); | ||
expect(button).toHaveTextContent('Not logged in'); | ||
test('when no email is provided, the dropdown text shows that there is no logged in user', async () => { | ||
render(<NoEmailAddress />); | ||
const button = screen.getByRole('button'); | ||
expect(button).toHaveTextContent('Not logged in'); | ||
}); | ||
}); |
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