Skip to content

Commit

Permalink
FRONTEND: tweaks (#3671)
Browse files Browse the repository at this point in the history
# Description and Motivation
<!--- bulleted, high level items. use keywords (eg "closes #144" or
"fixes #4323") -->

- fixes multi map title (removes misleading subtitle)
- adds `(NH)` to black men report subtitle
- add more descriptive link text for missing data per lighthouse

## Has this been tested? How?

passing


## Types of changes

(leave all that apply)

- Bug fix


## New frontend preview link is below in the Netlify comment 😎
  • Loading branch information
benhammondmusic authored Sep 16, 2024
1 parent 491d311 commit b711482
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
12 changes: 6 additions & 6 deletions frontend/playwright-tests/black_men_gun_homicides.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test('Black Men Homicide Test: Top Half of Cards', async ({ page }) => {
.click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Black Men' })
.getByRole('heading', { name: 'Black (NH) Men' })
.click()

Check failure on line 16 in frontend/playwright-tests/black_men_gun_homicides.ci.spec.ts

View workflow job for this annotation

GitHub Actions / Runs frontend E2E_STAGING on main whenever code is pushed (or merged)

[E2E_NIGHTLY] › black_men_gun_homicides.ci.spec.ts:3:1 › Black Men Homicide Test: Top Half of Cards

1) [E2E_NIGHTLY] › black_men_gun_homicides.ci.spec.ts:3:1 › Black Men Homicide Test: Top Half of Cards Error: locator.click: Test timeout of 120000ms exceeded. Call log: - waiting for locator('#rate-map').getByRole('heading', { name: 'Black (NH) Men' }) 14 | .locator('#rate-map') 15 | .getByRole('heading', { name: 'Black (NH) Men' }) > 16 | .click() | ^ 17 | await page 18 | .locator('li') 19 | .filter({ hasText: 'Total population of Black (NH) Men' }) at /home/runner/work/health-equity-tracker/health-equity-tracker/frontend/playwright-tests/black_men_gun_homicides.ci.spec.ts:16:6
await page
.locator('li')
.filter({ hasText: 'Total population of Black Men' })
.filter({ hasText: 'Total population of Black (NH) Men' })
.click()
await page
.getByRole('heading', {
Expand All @@ -25,7 +25,7 @@ test('Black Men Homicide Test: Top Half of Cards', async ({ page }) => {
.click()
await page
.locator('#rates-over-time')
.getByRole('heading', { name: 'Black Men' })
.getByRole('heading', { name: 'Black (NH) Men' })
.click()
})

Expand All @@ -40,7 +40,7 @@ test('Black Men Homicide Test: Bottom Half of Cards', async ({ page }) => {
.click()
await page
.locator('#rate-chart')
.getByRole('heading', { name: 'Black Men' })
.getByRole('heading', { name: 'Black (NH) Men' })
.click()

Check failure on line 44 in frontend/playwright-tests/black_men_gun_homicides.ci.spec.ts

View workflow job for this annotation

GitHub Actions / Runs frontend E2E_STAGING on main whenever code is pushed (or merged)

[E2E_NIGHTLY] › black_men_gun_homicides.ci.spec.ts:32:1 › Black Men Homicide Test: Bottom Half of Cards

2) [E2E_NIGHTLY] › black_men_gun_homicides.ci.spec.ts:32:1 › Black Men Homicide Test: Bottom Half of Cards Error: locator.click: Test timeout of 120000ms exceeded. Call log: - waiting for locator('#rate-chart').getByRole('heading', { name: 'Black (NH) Men' }) 42 | .locator('#rate-chart') 43 | .getByRole('heading', { name: 'Black (NH) Men' }) > 44 | .click() | ^ 45 | await page 46 | .getByRole('button', { name: 'Inequities over time', exact: true }) 47 | .click() at /home/runner/work/health-equity-tracker/health-equity-tracker/frontend/playwright-tests/black_men_gun_homicides.ci.spec.ts:44:6
await page
.getByRole('button', { name: 'Inequities over time', exact: true })
Expand All @@ -50,7 +50,7 @@ test('Black Men Homicide Test: Bottom Half of Cards', async ({ page }) => {
.click()
await page
.locator('#inequities-over-time')
.getByRole('heading', { name: 'Black Men' })
.getByRole('heading', { name: 'Black (NH) Men' })
.click()
await page
.locator('#inequities-over-time')
Expand All @@ -61,7 +61,7 @@ test('Black Men Homicide Test: Bottom Half of Cards', async ({ page }) => {
.click()
await page
.locator('#population-vs-distribution')
.getByRole('heading', { name: 'Black Men' })
.getByRole('heading', { name: 'Black (NH) Men' })
.click()
await page.getByLabel('Comparison bar chart showing').getByRole('img').click()
await page.getByRole('button', { name: 'Data table' }).click()
Expand Down
28 changes: 18 additions & 10 deletions frontend/playwright-tests/incarceration.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ import { test } from '@playwright/test'
test('Prison by Race', async ({ page }) => {
await page.goto('/exploredata?mls=1.incarceration-3.00&group1=All')
await page
.getByLabel(
'Launch multiple maps view with side-by-side maps of each race and ethnicity group'
)
.locator('#rate-map')
.getByRole('heading', { name: 'Prison incarceration in the' })
.click()
await page.getByRole('button', { name: 'Close' }).click()
await page.getByLabel('open the topic info modal').click()
await page.getByRole('heading', { name: 'People in prison' }).click()
await page.getByLabel('Click for more info on people').click()
await page.getByLabel('close topic info modal').click()
await page.locator('li').filter({ hasText: 'United States' }).click()
await page
.getByRole('heading', { name: 'Graph unavailable: Rates of' })
.click()
await page.getByText('Our data sources do not have').click()
await page
.locator('#rate-chart')
.getByText(
'3,232 children confined in adult facilities in the United States. Learn more.'
)
.getByRole('heading', { name: 'Prison incarceration in the' })
.click()

await page.locator('#rate-chart').getByText('children').click()

Check failure on line 20 in frontend/playwright-tests/incarceration.ci.spec.ts

View workflow job for this annotation

GitHub Actions / build

[E2E_NIGHTLY] › incarceration.ci.spec.ts:3:1 › Prison by Race

1) [E2E_NIGHTLY] › incarceration.ci.spec.ts:3:1 › Prison by Race ───────────────────────────────── Error: locator.click: Test timeout of 120000ms exceeded. Call log: - waiting for locator('#rate-chart').getByText('children') 18 | .getByRole('heading', { name: 'Prison incarceration in the' }) 19 | .click() > 20 | await page.locator('#rate-chart').getByText('children').click() | ^ 21 | await page.getByRole('button', { name: 'Unknown demographic map' }).click() 22 | await page 23 | .locator('#unknown-demographic-map') at /home/runner/work/health-equity-tracker/health-equity-tracker/frontend/playwright-tests/incarceration.ci.spec.ts:20:59

Check failure on line 20 in frontend/playwright-tests/incarceration.ci.spec.ts

View workflow job for this annotation

GitHub Actions / build

[E2E_NIGHTLY] › incarceration.ci.spec.ts:3:1 › Prison by Race

1) [E2E_NIGHTLY] › incarceration.ci.spec.ts:3:1 › Prison by Race ───────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 120000ms exceeded. Call log: - waiting for locator('#rate-chart').getByText('children') 18 | .getByRole('heading', { name: 'Prison incarceration in the' }) 19 | .click() > 20 | await page.locator('#rate-chart').getByText('children').click() | ^ 21 | await page.getByRole('button', { name: 'Unknown demographic map' }).click() 22 | await page 23 | .locator('#unknown-demographic-map') at /home/runner/work/health-equity-tracker/health-equity-tracker/frontend/playwright-tests/incarceration.ci.spec.ts:20:59

Check failure on line 20 in frontend/playwright-tests/incarceration.ci.spec.ts

View workflow job for this annotation

GitHub Actions / build

[E2E_NIGHTLY] › incarceration.ci.spec.ts:3:1 › Prison by Race

1) [E2E_NIGHTLY] › incarceration.ci.spec.ts:3:1 › Prison by Race ───────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 120000ms exceeded. Call log: - waiting for locator('#rate-chart').getByText('children') 18 | .getByRole('heading', { name: 'Prison incarceration in the' }) 19 | .click() > 20 | await page.locator('#rate-chart').getByText('children').click() | ^ 21 | await page.getByRole('button', { name: 'Unknown demographic map' }).click() 22 | await page 23 | .locator('#unknown-demographic-map') at /home/runner/work/health-equity-tracker/health-equity-tracker/frontend/playwright-tests/incarceration.ci.spec.ts:20:59
await page.getByRole('button', { name: 'Unknown demographic map' }).click()
await page
.locator('#unknown-demographic-map')
.getByText('0.4% of prison pop. reported')
.click()
await page.getByRole('button', { name: 'Data table' }).click()
await page.getByRole('columnheader', { name: 'Race and Ethnicity' }).click()
await page.getByRole('button', { name: 'Prison', exact: true }).click()
await page.getByRole('button', { name: 'Jail' }).click()
Expand All @@ -34,6 +40,8 @@ test('Jail by Age', async ({ page }) => {
await page.getByLabel('Click for more info on people in jail').click()
await page.getByRole('heading', { name: 'People in jail' }).click()
await page.getByLabel('close topic info modal').click()
await page.getByRole('button', { name: 'Data table' }).click()

await page.getByRole('columnheader', { name: 'Age' }).click()
await page
.getByRole('columnheader', { name: 'People in jail per 100k' })
Expand Down
1 change: 0 additions & 1 deletion frontend/src/cards/ui/MultiMapDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export default function MultiMapDialog(props: MultiMapDialogProps) {
id='modalTitle'
>
{title}
{props?.subtitle && ` (${props.subtitle})`}
</h2>
</div>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/data/config/MetricConfigCommunitySafety.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,6 @@ export const GUN_DEATHS_BLACK_MEN_METRICS: DataTypeConfig[] = [
},
},
},
otherSubPopulationLabel: 'Black Men',
otherSubPopulationLabel: 'Black (NH) Men',
},
]
2 changes: 1 addition & 1 deletion frontend/src/reports/ui/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Banner: React.FC = () => {
</p>
<HetTextArrowLink
link={`${METHODOLOGY_PAGE_LINK}/limitations#missing-data`}
linkText='Learn more'
linkText='Learn more about the data limitations'
containerClassName='block md:mx-2 md:my-0 mx-0 my-4'
linkClassName='text-black'
/>
Expand Down

0 comments on commit b711482

Please sign in to comment.