Skip to content

Commit 93d2b4b

Browse files
authored
chore(html): consistent padding between nav link content (microsoft#36816)
1 parent bcb5e67 commit 93d2b4b

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

packages/html-reporter/src/common.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ article, aside, details, figcaption, figure, footer, header, main, menu, nav, se
203203
flex: none;
204204
position: relative;
205205
float: left;
206-
padding: 5px 10px;
206+
padding: 5px 8px;
207207
font-weight: 500;
208208
line-height: 20px;
209209
color: var(--color-fg-default);
@@ -228,6 +228,14 @@ article, aside, details, figcaption, figure, footer, header, main, menu, nav, se
228228
margin-left: -1px;
229229
}
230230

231+
.subnav-item .octicon {
232+
margin-right: 8px;
233+
}
234+
235+
.subnav-item-label {
236+
margin-right: 8px;
237+
}
238+
231239
.counter {
232240
display: inline-block;
233241
min-width: 20px;
@@ -293,7 +301,6 @@ article, aside, details, figcaption, figure, footer, header, main, menu, nav, se
293301
}
294302

295303
.subnav-item {
296-
padding: 5px 3px;
297304
border: none;
298305
}
299306

packages/html-reporter/src/headerView.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ test('should render counters', async ({ mount }) => {
3838
await expect(component.locator('a', { hasText: 'Skipped' }).locator('.counter')).toHaveText('10');
3939
await expect(component).toMatchAriaSnapshot(`
4040
- navigation:
41-
- link "All 90"
42-
- text: Passed 42 Failed 31 Flaky 17 Skipped 10
41+
- link "All90"
42+
- text: Passed42 Failed31 Flaky17 Skipped10
4343
`);
4444
});
4545

packages/html-reporter/src/headerView.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,27 @@ const StatsNavView: React.FC<{
8585
const q = searchParams.get('q')?.toString() || '';
8686
return <nav>
8787
<Link className='subnav-item' href='#?'>
88-
All <span className='d-inline counter'>{stats.total - stats.skipped}</span>
88+
<span className='subnav-item-label'>All</span>
89+
<span className='d-inline counter'>{stats.total - stats.skipped}</span>
8990
</Link>
9091
<Link className='subnav-item' click={filterWithQuery(q, 's:passed', false)} ctrlClick={filterWithQuery(q, 's:passed', true)}>
91-
Passed <span className='d-inline counter'>{stats.expected}</span>
92+
<span className='subnav-item-label'>Passed</span>
93+
<span className='d-inline counter'>{stats.expected}</span>
9294
</Link>
9395
<Link className='subnav-item' click={filterWithQuery(q, 's:failed', false)} ctrlClick={filterWithQuery(q, 's:failed', true)}>
94-
{!!stats.unexpected && statusIcon('unexpected')} Failed <span className='d-inline counter'>{stats.unexpected}</span>
96+
{!!stats.unexpected && statusIcon('unexpected')}
97+
<span className='subnav-item-label'>Failed</span>
98+
<span className='d-inline counter'>{stats.unexpected}</span>
9599
</Link>
96100
<Link className='subnav-item' click={filterWithQuery(q, 's:flaky', false)} ctrlClick={filterWithQuery(q, 's:flaky', true)}>
97-
{!!stats.flaky && statusIcon('flaky')} Flaky <span className='d-inline counter'>{stats.flaky}</span>
101+
{!!stats.flaky && statusIcon('flaky')}
102+
<span className='subnav-item-label'>Flaky</span>
103+
<span className='d-inline counter'>{stats.flaky}</span>
98104
</Link>
99105
<Link className='subnav-item' click={filterWithQuery(q, 's:skipped', false)} ctrlClick={filterWithQuery(q, 's:skipped', true)}>
100-
{!!stats.skipped && statusIcon('skipped')} Skipped <span className='d-inline counter'>{stats.skipped}</span>
106+
{!!stats.skipped && statusIcon('skipped')}
107+
<span className='subnav-item-label'>Skipped</span>
108+
<span className='d-inline counter'>{stats.skipped}</span>
101109
</Link>
102110
</nav>;
103111
};

0 commit comments

Comments
 (0)