Skip to content

Commit f1256b3

Browse files
ci: apply automated fixes
1 parent 20cb3f0 commit f1256b3

8 files changed

Lines changed: 70 additions & 35 deletions

File tree

‎e2e/react-router/escaped-special-strings/src/routes/[_]layout.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ function EscapedUnderscoreLayoutComponent() {
1212
<h2 data-testid="page-title">Escaped Underscore Layout Page</h2>
1313
<p data-testid="page-path">/_layout</p>
1414
<p data-testid="page-description">
15-
This route was created using [_]layout.tsx to escape the leading underscore.
16-
It renders at the literal path /_layout instead of being a pathless layout.
15+
This route was created using [_]layout.tsx to escape the leading
16+
underscore. It renders at the literal path /_layout instead of being a
17+
pathless layout.
1718
</p>
1819
</div>
1920
)

‎e2e/react-router/escaped-special-strings/src/routes/[index].tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ function EscapedIndexComponent() {
1212
<h2 data-testid="page-title">Escaped Index Page</h2>
1313
<p data-testid="page-path">/index</p>
1414
<p data-testid="page-description">
15-
This route was created using [index].tsx to escape the special "index" token.
16-
It renders at the literal path /index instead of being the index route.
15+
This route was created using [index].tsx to escape the special "index"
16+
token. It renders at the literal path /index instead of being the index
17+
route.
1718
</p>
1819
</div>
1920
)

‎e2e/react-router/escaped-special-strings/src/routes/[lazy].tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ function EscapedLazyComponent() {
1212
<h2 data-testid="page-title">Escaped Lazy Page</h2>
1313
<p data-testid="page-path">/lazy</p>
1414
<p data-testid="page-description">
15-
This route was created using [lazy].tsx to escape the special "lazy" token.
16-
It renders at the literal path /lazy instead of being a lazy-loaded route.
15+
This route was created using [lazy].tsx to escape the special "lazy"
16+
token. It renders at the literal path /lazy instead of being a
17+
lazy-loaded route.
1718
</p>
1819
</div>
1920
)

‎e2e/react-router/escaped-special-strings/src/routes/[route].tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ function EscapedRouteComponent() {
1212
<h2 data-testid="page-title">Escaped Route Page</h2>
1313
<p data-testid="page-path">/route</p>
1414
<p data-testid="page-description">
15-
This route was created using [route].tsx to escape the special "route" token.
16-
It renders at the literal path /route instead of being a layout configuration.
15+
This route was created using [route].tsx to escape the special "route"
16+
token. It renders at the literal path /route instead of being a layout
17+
configuration.
1718
</p>
1819
</div>
1920
)

‎e2e/react-router/escaped-special-strings/src/routes/__root.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ function RootComponent() {
1616
return (
1717
<div>
1818
<h1>Escaped Special Strings Test</h1>
19-
<nav style={{ display: 'flex', gap: '1rem', padding: '1rem', borderBottom: '1px solid #ccc' }}>
19+
<nav
20+
style={{
21+
display: 'flex',
22+
gap: '1rem',
23+
padding: '1rem',
24+
borderBottom: '1px solid #ccc',
25+
}}
26+
>
2027
<Link to="/index" data-testid="link-index">
2128
/index
2229
</Link>

‎e2e/react-router/escaped-special-strings/src/routes/blog[_].tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ function EscapedBlogUnderscoreComponent() {
1212
<h2 data-testid="page-title">Escaped Blog Underscore Page</h2>
1313
<p data-testid="page-path">/blog_</p>
1414
<p data-testid="page-description">
15-
This route was created using blog[_].tsx to escape the trailing underscore.
16-
It renders at the literal path /blog_ with the underscore preserved in the URL.
15+
This route was created using blog[_].tsx to escape the trailing
16+
underscore. It renders at the literal path /blog_ with the underscore
17+
preserved in the URL.
1718
</p>
1819
</div>
1920
)

‎e2e/react-router/escaped-special-strings/tests/escaped-routes.spec.ts‎

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,60 @@ test.describe('Escaped special strings routing', () => {
44
test('escaped [index] route renders at /index path', async ({ page }) => {
55
await page.goto('/index')
66

7-
await expect(page.getByTestId('page-title')).toContainText('Escaped Index Page')
7+
await expect(page.getByTestId('page-title')).toContainText(
8+
'Escaped Index Page',
9+
)
810
await expect(page.getByTestId('page-path')).toContainText('/index')
911
await expect(page.getByTestId('page-description')).toContainText(
10-
'escape the special "index" token'
12+
'escape the special "index" token',
1113
)
1214
})
1315

1416
test('escaped [route] route renders at /route path', async ({ page }) => {
1517
await page.goto('/route')
1618

17-
await expect(page.getByTestId('page-title')).toContainText('Escaped Route Page')
19+
await expect(page.getByTestId('page-title')).toContainText(
20+
'Escaped Route Page',
21+
)
1822
await expect(page.getByTestId('page-path')).toContainText('/route')
1923
await expect(page.getByTestId('page-description')).toContainText(
20-
'escape the special "route" token'
24+
'escape the special "route" token',
2125
)
2226
})
2327

2428
test('escaped [lazy] route renders at /lazy path', async ({ page }) => {
2529
await page.goto('/lazy')
2630

27-
await expect(page.getByTestId('page-title')).toContainText('Escaped Lazy Page')
31+
await expect(page.getByTestId('page-title')).toContainText(
32+
'Escaped Lazy Page',
33+
)
2834
await expect(page.getByTestId('page-path')).toContainText('/lazy')
2935
await expect(page.getByTestId('page-description')).toContainText(
30-
'escape the special "lazy" token'
36+
'escape the special "lazy" token',
3137
)
3238
})
3339

3440
test('escaped [_]layout route renders at /_layout path', async ({ page }) => {
3541
await page.goto('/_layout')
3642

37-
await expect(page.getByTestId('page-title')).toContainText('Escaped Underscore Layout Page')
43+
await expect(page.getByTestId('page-title')).toContainText(
44+
'Escaped Underscore Layout Page',
45+
)
3846
await expect(page.getByTestId('page-path')).toContainText('/_layout')
3947
await expect(page.getByTestId('page-description')).toContainText(
40-
'escape the leading underscore'
48+
'escape the leading underscore',
4149
)
4250
})
4351

4452
test('escaped blog[_] route renders at /blog_ path', async ({ page }) => {
4553
await page.goto('/blog_')
4654

47-
await expect(page.getByTestId('page-title')).toContainText('Escaped Blog Underscore Page')
55+
await expect(page.getByTestId('page-title')).toContainText(
56+
'Escaped Blog Underscore Page',
57+
)
4858
await expect(page.getByTestId('page-path')).toContainText('/blog_')
4959
await expect(page.getByTestId('page-description')).toContainText(
50-
'escape the trailing underscore'
60+
'escape the trailing underscore',
5161
)
5262
})
5363

@@ -56,42 +66,55 @@ test.describe('Escaped special strings routing', () => {
5666
await page.getByTestId('link-index').click()
5767
await page.waitForURL('/index')
5868

59-
await expect(page.getByTestId('page-title')).toContainText('Escaped Index Page')
69+
await expect(page.getByTestId('page-title')).toContainText(
70+
'Escaped Index Page',
71+
)
6072
})
6173

6274
test('client-side navigation to escaped /route route', async ({ page }) => {
6375
await page.goto('/index')
6476
await page.getByTestId('link-route').click()
6577
await page.waitForURL('/route')
6678

67-
await expect(page.getByTestId('page-title')).toContainText('Escaped Route Page')
79+
await expect(page.getByTestId('page-title')).toContainText(
80+
'Escaped Route Page',
81+
)
6882
})
6983

7084
test('client-side navigation to escaped /lazy route', async ({ page }) => {
7185
await page.goto('/index')
7286
await page.getByTestId('link-lazy').click()
7387
await page.waitForURL('/lazy')
7488

75-
await expect(page.getByTestId('page-title')).toContainText('Escaped Lazy Page')
89+
await expect(page.getByTestId('page-title')).toContainText(
90+
'Escaped Lazy Page',
91+
)
7692
})
7793

7894
test('client-side navigation to escaped /_layout route', async ({ page }) => {
7995
await page.goto('/index')
8096
await page.getByTestId('link-underscore-layout').click()
8197
await page.waitForURL('/_layout')
8298

83-
await expect(page.getByTestId('page-title')).toContainText('Escaped Underscore Layout Page')
99+
await expect(page.getByTestId('page-title')).toContainText(
100+
'Escaped Underscore Layout Page',
101+
)
84102
})
85103

86104
test('client-side navigation to escaped /blog_ route', async ({ page }) => {
87105
await page.goto('/index')
88106
await page.getByTestId('link-blog-underscore').click()
89107
await page.waitForURL('/blog_')
90108

91-
await expect(page.getByTestId('page-title')).toContainText('Escaped Blog Underscore Page')
109+
await expect(page.getByTestId('page-title')).toContainText(
110+
'Escaped Blog Underscore Page',
111+
)
92112
})
93113

94-
test('URL is correct for escaped routes with underscores', async ({ page, baseURL }) => {
114+
test('URL is correct for escaped routes with underscores', async ({
115+
page,
116+
baseURL,
117+
}) => {
95118
await page.goto('/_layout')
96119
expect(page.url()).toBe(`${baseURL}/_layout`)
97120

‎packages/router-generator/tests/utils.test.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,10 @@ describe('removeLayoutSegmentsWithEscape', () => {
444444
'/foo',
445445
)
446446
expect(
447-
removeLayoutSegmentsWithEscape('/_auth/_admin/dashboard', '/_auth/_admin/dashboard'),
447+
removeLayoutSegmentsWithEscape(
448+
'/_auth/_admin/dashboard',
449+
'/_auth/_admin/dashboard',
450+
),
448451
).toBe('/dashboard')
449452
})
450453

@@ -461,9 +464,9 @@ describe('removeLayoutSegmentsWithEscape', () => {
461464
expect(
462465
removeLayoutSegmentsWithEscape('/_layout/foo', '/[_layout]/foo'),
463466
).toBe('/_layout/foo')
464-
expect(
465-
removeLayoutSegmentsWithEscape('/_1nd3x/bar', '/[_1nd3x]/bar'),
466-
).toBe('/_1nd3x/bar')
467+
expect(removeLayoutSegmentsWithEscape('/_1nd3x/bar', '/[_1nd3x]/bar')).toBe(
468+
'/_1nd3x/bar',
469+
)
467470
})
468471

469472
it('handles mixed escaped and non-escaped layout segments', () => {
@@ -474,10 +477,7 @@ describe('removeLayoutSegmentsWithEscape', () => {
474477
),
475478
).toBe('/_auth/dashboard')
476479
expect(
477-
removeLayoutSegmentsWithEscape(
478-
'/_foo/_bar/_baz',
479-
'/_foo/[_bar]/_baz',
480-
),
480+
removeLayoutSegmentsWithEscape('/_foo/_bar/_baz', '/_foo/[_bar]/_baz'),
481481
).toBe('/_bar')
482482
})
483483

0 commit comments

Comments
 (0)