From b0229b0145a1c754e11ee7cee65abaa037015665 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Mon, 11 Mar 2024 00:21:45 -0400
Subject: [PATCH] Ignore hash URLs
---
test-app/app/templates/application.hbs | 4 +++-
test-support/src/routing/visit-all.ts | 16 +++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/test-app/app/templates/application.hbs b/test-app/app/templates/application.hbs
index 25e48aa..ca7cdb3 100644
--- a/test-app/app/templates/application.hbs
+++ b/test-app/app/templates/application.hbs
@@ -5,4 +5,6 @@
{{outlet}}
here
-here
\ No newline at end of file
+here
+here
+/ here
\ No newline at end of file
diff --git a/test-support/src/routing/visit-all.ts b/test-support/src/routing/visit-all.ts
index 23e4bc4..d0caaf1 100644
--- a/test-support/src/routing/visit-all.ts
+++ b/test-support/src/routing/visit-all.ts
@@ -47,7 +47,21 @@ export async function visitAllLinks() {
continue;
}
- const key = `${currentURL()}::${toVisit}`;
+ // In-page links are on the page we're already on.
+ // As long as we haven't already encountered an error,
+ // this is silly to check.
+ if (toVisit.startsWith('#')) {
+ continue;
+ }
+
+ const [nonHashPart] = toVisit.split('#');
+
+ // This was our first page, we've already been here
+ if (nonHashPart === '/') {
+ continue;
+ }
+
+ const key = `${currentURL()}::${nonHashPart}`;
if (visited.has(key)) continue;