···8888 }
89899090 root.addEventListener("page-enter", async () => {
9191- if (isAuthenticated) {
9292- dataLayer.declarative.ensureCurrentUser();
9393- }
9491 // Load the post thread to get the post like count
9592 dataLayer.declarative.ensurePostThread(postUri);
9693 await loadLikes();
-3
src/js/views/postQuotes.view.js
···9393 }
94949595 root.addEventListener("page-enter", async () => {
9696- if (isAuthenticated) {
9797- dataLayer.declarative.ensureCurrentUser();
9898- }
9996 // Load the post thread to get the post quote count
10097 dataLayer.declarative.ensurePostThread(postUri);
10198 await loadQuotes();
-3
src/js/views/postReposts.view.js
···8787 }
88888989 root.addEventListener("page-enter", async () => {
9090- if (isAuthenticated) {
9191- dataLayer.declarative.ensureCurrentUser();
9292- }
9390 // Load the post thread to get the post repost count
9491 dataLayer.declarative.ensurePostThread(postUri);
9592 await loadReposts();
···1313 await expect(page.locator("#home-view")).toBeVisible({ timeout: 10000 });
1414 });
15151616- test("keeps a single layout whose active nav item follows navigation and hides on bare routes", async ({
1616+ test("keeps a single layout whose active nav item follows navigation, including the not-found page", async ({
1717 page,
1818 }) => {
1919 const layoutRoot = page.locator("#main-layout");
···5353 notificationsNavItem.locator(".icon.filled"),
5454 ).not.toBeVisible();
55555656- // Bare routes (layout: false, e.g. the not-found page) hide the layout
5757- // entirely. /login can't be used here: it redirects authenticated users.
5656+ // The not-found page keeps the layout, with no active nav item
5857 await page.goto("/this-route-does-not-exist");
5958 await expect(page.locator("#not-found-view")).toBeVisible({
6059 timeout: 10000,
6160 });
6262- await expect(layoutRoot).toHaveClass(/layout-hidden/);
6363- await expect(layoutRoot).not.toBeVisible();
6161+ await expect(layoutRoot).toBeVisible();
6262+ await expect(layoutRoot.locator(".icon.filled")).not.toBeVisible();
64636565- // Returning to a layout route shows the chrome again
6464+ // Returning to a layout route restores the active nav item
6665 await page.goto("/");
6766 await expect(page.locator("#home-view")).toBeVisible({ timeout: 10000 });
6868- await expect(layoutRoot).not.toHaveClass(/layout-hidden/);
6967 await expect(layoutRoot).toBeVisible();
7068 await expect(homeNavItem.locator(".icon.filled")).toBeVisible();
7169 });