-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TTA-HUB: 397 Add Pill Filters to Grantee Page (#481)
* first version of filter pills * added first version of filter pills * added tests for filter pill ui * change colors and add test * fixed issues found by Matt * fixed filter issues and specialists check boxes * fixed pill row spacing and moved AND to front * fix audit vuln * fix lint errors * wip * css fixes * code clean up * added unit test for tool tip and fixed filter pill test * align text in ellipsis pill * fixes based on Joshs PR review Co-authored-by: Matt Bevilacqua <[email protected]>
- Loading branch information
1 parent
210c2e3
commit 53da9e7
Showing
13 changed files
with
423 additions
and
67 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,46 @@ | ||
import '@testing-library/jest-dom'; | ||
import React from 'react'; | ||
import { | ||
render, screen, | ||
} from '@testing-library/react'; | ||
import Tooltip from '../Tooltip'; | ||
|
||
describe('Tooltip', () => { | ||
const renderTooltip = ( | ||
displayText, | ||
screenReadDisplayText, | ||
buttonLabel, | ||
tooltipText, | ||
hideUnderline, | ||
) => { | ||
render( | ||
<div data-testid="tooltip-container"> | ||
<Tooltip | ||
displayText={displayText} | ||
screenReadDisplayText={screenReadDisplayText} | ||
buttonLabel={buttonLabel} | ||
tooltipText={tooltipText} | ||
hideUnderline={hideUnderline} | ||
/> | ||
</div>, | ||
); | ||
}; | ||
|
||
afterAll(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('renders correctly', async () => { | ||
renderTooltip('my display text', false, 'my button label', 'my tool tip text', false); | ||
expect(await screen.findByText(/my tool tip text/i)).toBeVisible(); | ||
expect(await screen.findByText(/my button label/i)).toBeVisible(); | ||
expect(await screen.findByText(/my display text/i)).toBeVisible(); | ||
const button = await screen.findByRole('button', { name: /button label/i }); | ||
await expect(button).toBeInTheDocument(); | ||
await expect(document.querySelector('svg')).toBeInTheDocument(); | ||
}); | ||
it('renders without underline', async () => { | ||
renderTooltip('my display text', false, 'my button label', 'my tool tip text', true); | ||
await expect(document.querySelector('svg')).not.toBeInTheDocument(); | ||
}); | ||
}); |
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,11 @@ | ||
.filter-pill-container .smart-hub--ellipsis { | ||
display: inline; | ||
width: 290px; | ||
font-size: 16px; | ||
vertical-align: top; | ||
} | ||
|
||
.filter-pill-container .smart-hub--tooltip button { | ||
display: inline; | ||
line-height: 1.15; | ||
} |
Oops, something went wrong.