Skip to content

Commit b2e7c85

Browse files
committed
Switch to the new scroll restoration API & update snapshots
1 parent d445379 commit b2e7c85

File tree

9 files changed

+44
-24
lines changed

9 files changed

+44
-24
lines changed

frontend/src/components/Session/__snapshots__/LastActive.test.tsx.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
exports[`<LastActive > renders a default timestamp 1`] = `
44
<div>
55
<span
6-
title="Fri, 15 Sept 2023, 01:12"
6+
title="Fri, 15 Sep 2023 at 01:12"
77
>
8-
Active Fri, 15 Sept 2023, 01:12
8+
Active Fri, 15 Sep 2023 at 01:12
99
</span>
1010
</div>
1111
`;
1212
1313
exports[`<LastActive > renders a relative timestamp 1`] = `
1414
<div>
1515
<span
16-
title="Mon, 18 Sept 2023, 00:12"
16+
title="Mon, 18 Sep 2023 at 00:12"
1717
>
1818
Active 1 hour ago
1919
</span>
@@ -24,7 +24,7 @@ exports[`<LastActive > renders an 'active now' timestamp 1`] = `
2424
<div>
2525
<span
2626
class="_active_04756f"
27-
title="Mon, 18 Sept 2023, 01:12"
27+
title="Mon, 18 Sep 2023 at 01:12"
2828
>
2929
Active now
3030
</span>
@@ -34,7 +34,7 @@ exports[`<LastActive > renders an 'active now' timestamp 1`] = `
3434
exports[`<LastActive > renders an inactive timestamp 1`] = `
3535
<div>
3636
<span
37-
title="Mon, 19 Jun 2023, 01:12"
37+
title="Mon, 19 Jun 2023 at 01:12"
3838
>
3939
Inactive for 90+ days
4040
</span>

frontend/src/components/SessionDetail/__snapshots__/CompatSessionDetail.test.tsx.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ exports[`<CompatSessionDetail> > renders a compatability session details 1`] = `
5151
</h5>
5252
<span
5353
class="_datumValue_040867"
54-
title="Sat, 29 Jul 2023, 03:35"
54+
title="Sat, 29 Jul 2023 at 03:35"
5555
>
5656
Inactive for 90+ days
5757
</span>
@@ -68,7 +68,7 @@ exports[`<CompatSessionDetail> > renders a compatability session details 1`] = `
6868
class="_datumValue_040867"
6969
datetime="2023-06-29T03:35:17Z"
7070
>
71-
Thu, 29 Jun 2023, 03:35
71+
Thu, 29 Jun 2023 at 03:35
7272
</time>
7373
</div>
7474
<div
@@ -312,7 +312,7 @@ exports[`<CompatSessionDetail> > renders a compatability session without an ssoL
312312
</h5>
313313
<span
314314
class="_datumValue_040867"
315-
title="Sat, 29 Jul 2023, 03:35"
315+
title="Sat, 29 Jul 2023 at 03:35"
316316
>
317317
Inactive for 90+ days
318318
</span>
@@ -329,7 +329,7 @@ exports[`<CompatSessionDetail> > renders a compatability session without an ssoL
329329
class="_datumValue_040867"
330330
datetime="2023-06-29T03:35:17Z"
331331
>
332-
Thu, 29 Jun 2023, 03:35
332+
Thu, 29 Jun 2023 at 03:35
333333
</time>
334334
</div>
335335
<div
@@ -527,7 +527,7 @@ exports[`<CompatSessionDetail> > renders a finished compatability session detail
527527
</h5>
528528
<span
529529
class="_datumValue_040867"
530-
title="Sat, 29 Jul 2023, 03:35"
530+
title="Sat, 29 Jul 2023 at 03:35"
531531
>
532532
Inactive for 90+ days
533533
</span>
@@ -544,7 +544,7 @@ exports[`<CompatSessionDetail> > renders a finished compatability session detail
544544
class="_datumValue_040867"
545545
datetime="2023-06-29T03:35:17Z"
546546
>
547-
Thu, 29 Jun 2023, 03:35
547+
Thu, 29 Jun 2023 at 03:35
548548
</time>
549549
</div>
550550
<div
@@ -586,7 +586,7 @@ exports[`<CompatSessionDetail> > renders a finished compatability session detail
586586
<time
587587
datetime="2023-07-29T03:35:17Z"
588588
>
589-
Sat, 29 Jul 2023, 03:35
589+
Sat, 29 Jul 2023 at 03:35
590590
</time>
591591
</div>
592592
</div>

frontend/src/components/SessionDetail/__snapshots__/OAuth2SessionDetail.test.tsx.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ exports[`<OAuth2SessionDetail> > renders a finished session details 1`] = `
5151
</h5>
5252
<span
5353
class="_datumValue_040867"
54-
title="Sat, 29 Jul 2023, 03:35"
54+
title="Sat, 29 Jul 2023 at 03:35"
5555
>
5656
Inactive for 90+ days
5757
</span>
@@ -68,7 +68,7 @@ exports[`<OAuth2SessionDetail> > renders a finished session details 1`] = `
6868
class="_datumValue_040867"
6969
datetime="2023-06-29T03:35:17Z"
7070
>
71-
Thu, 29 Jun 2023, 03:35
71+
Thu, 29 Jun 2023 at 03:35
7272
</time>
7373
</div>
7474
<div
@@ -110,7 +110,7 @@ exports[`<OAuth2SessionDetail> > renders a finished session details 1`] = `
110110
<time
111111
datetime="2023-07-29T03:35:17Z"
112112
>
113-
Sat, 29 Jul 2023, 03:35
113+
Sat, 29 Jul 2023 at 03:35
114114
</time>
115115
</div>
116116
</div>
@@ -313,7 +313,7 @@ exports[`<OAuth2SessionDetail> > renders session details 1`] = `
313313
</h5>
314314
<span
315315
class="_datumValue_040867"
316-
title="Sat, 29 Jul 2023, 03:35"
316+
title="Sat, 29 Jul 2023 at 03:35"
317317
>
318318
Inactive for 90+ days
319319
</span>
@@ -330,7 +330,7 @@ exports[`<OAuth2SessionDetail> > renders session details 1`] = `
330330
class="_datumValue_040867"
331331
datetime="2023-06-29T03:35:17Z"
332332
>
333-
Thu, 29 Jun 2023, 03:35
333+
Thu, 29 Jun 2023 at 03:35
334334
</time>
335335
</div>
336336
<div

frontend/src/components/__snapshots__/CompatSession.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ exports[`<CompatSession /> > renders a finished session 1`] = `
6060
<time
6161
datetime="2023-06-29T03:35:17Z"
6262
>
63-
Thu, 29 Jun 2023, 03:35
63+
Thu, 29 Jun 2023 at 03:35
6464
</time>
6565
</div>
6666
</li>
@@ -140,7 +140,7 @@ exports[`<CompatSession /> > renders an active session 1`] = `
140140
<time
141141
datetime="2023-06-29T03:35:17Z"
142142
>
143-
Thu, 29 Jun 2023, 03:35
143+
Thu, 29 Jun 2023 at 03:35
144144
</time>
145145
</div>
146146
</li>

frontend/src/components/__snapshots__/OAuth2Session.test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ exports[`<OAuth2Session /> > renders a finished session 1`] = `
5757
<time
5858
datetime="2023-06-29T03:35:17Z"
5959
>
60-
Thu, 29 Jun 2023, 03:35
60+
Thu, 29 Jun 2023 at 03:35
6161
</time>
6262
</div>
6363
</li>
@@ -134,7 +134,7 @@ exports[`<OAuth2Session /> > renders an active session 1`] = `
134134
<time
135135
datetime="2023-06-29T03:35:17Z"
136136
>
137-
Thu, 29 Jun 2023, 03:35
137+
Thu, 29 Jun 2023 at 03:35
138138
</time>
139139
</div>
140140
</li>
@@ -243,7 +243,7 @@ exports[`<OAuth2Session /> > renders correct icon for a native session 1`] = `
243243
<time
244244
datetime="2023-06-29T03:35:17Z"
245245
>
246-
Thu, 29 Jun 2023, 03:35
246+
Thu, 29 Jun 2023 at 03:35
247247
</time>
248248
</div>
249249
</li>

frontend/src/router.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { routeTree } from "./routeTree.gen";
1313
// Create a new router instance
1414
export const router = createRouter({
1515
routeTree,
16+
scrollRestoration: true,
1617
basepath: config.root,
1718
defaultPendingComponent: LoadingScreen,
1819
defaultPreload: "intent",

frontend/src/routes/__root.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
99
import {
1010
type ErrorRouteComponent,
1111
Outlet,
12-
ScrollRestoration,
1312
createRootRouteWithContext,
1413
} from "@tanstack/react-router";
1514
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
@@ -28,7 +27,6 @@ export const Route = createRootRouteWithContext<{
2827
}>()({
2928
component: () => (
3029
<>
31-
<ScrollRestoration />
3230
<Outlet />
3331

3432
{import.meta.env.DEV &&

frontend/tests/routes/__snapshots__/reset-cross-signing.test.tsx.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ exports[`Reset cross signing > renders the cancelled page 1`] = `
4848
</p>
4949
</div>
5050
</div>
51+
<script>
52+
53+
</script>
5154
</DocumentFragment>
5255
`;
5356

@@ -234,6 +237,9 @@ exports[`Reset cross signing > renders the deep link page 1`] = `
234237
</p>
235238
</footer>
236239
</div>
240+
<script>
241+
242+
</script>
237243
</DocumentFragment>
238244
`;
239245

@@ -322,6 +328,9 @@ exports[`Reset cross signing > renders the errored page 1`] = `
322328
</p>
323329
</footer>
324330
</div>
331+
<script>
332+
333+
</script>
325334
</DocumentFragment>
326335
`;
327336

@@ -508,6 +517,9 @@ exports[`Reset cross signing > renders the page 1`] = `
508517
</p>
509518
</footer>
510519
</div>
520+
<script>
521+
522+
</script>
511523
</DocumentFragment>
512524
`;
513525

@@ -554,6 +566,9 @@ exports[`Reset cross signing > renders the success page 1`] = `
554566
</p>
555567
</div>
556568
</div>
569+
<script>
570+
571+
</script>
557572
</DocumentFragment>
558573
`;
559574

@@ -600,5 +615,8 @@ exports[`Reset cross signing > renders the success page 2`] = `
600615
</p>
601616
</div>
602617
</div>
618+
<script>
619+
620+
</script>
603621
</DocumentFragment>
604622
`;

frontend/tests/routes/account/__snapshots__/index.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,5 +736,8 @@ exports[`Account home page > renders the page 1`] = `
736736
</p>
737737
</footer>
738738
</div>
739+
<script>
740+
741+
</script>
739742
</DocumentFragment>
740743
`;

0 commit comments

Comments
 (0)