about summary refs log tree commit diff
path: root/__tests__
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-10-10 14:02:50 -0700
committerGitHub <noreply@github.com>2023-10-10 14:02:50 -0700
commit4d450da1941464b19dab201202ba3e9f41d2c057 (patch)
tree2ada6a3db2d364741df128919192bef4c96f7929 /__tests__
parente878da04a1f84e1b64caf18ecf5b60ee1c583d85 (diff)
downloadvoidsky-4d450da1941464b19dab201202ba3e9f41d2c057.tar.zst
Only warn on links to bsky.app if it represents itself as another url (#1662)
* Only warn on links to bsky.app if it represents itself as another url (close #1652)

* Clean up
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/lib/strings/url-helpers.test.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/__tests__/lib/strings/url-helpers.test.ts b/__tests__/lib/strings/url-helpers.test.ts
index 3055a9ef6..8bb52ed40 100644
--- a/__tests__/lib/strings/url-helpers.test.ts
+++ b/__tests__/lib/strings/url-helpers.test.ts
@@ -27,6 +27,42 @@ describe('linkRequiresWarning', () => {
     ['http://site.pages', 'http://site.pages.dev', true],
     ['http://site.pages.dev', 'site.pages', true],
     ['http://site.pages', 'site.pages.dev', true],
+    ['http://bsky.app/profile/bob.test/post/3kbeuduu7m22v', 'my post', false],
+    ['https://bsky.app/profile/bob.test/post/3kbeuduu7m22v', 'my post', false],
+    ['http://bsky.app/', 'bluesky', false],
+    ['https://bsky.app/', 'bluesky', false],
+    [
+      'http://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      'http://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      false,
+    ],
+    [
+      'https://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      'http://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      false,
+    ],
+    [
+      'http://bsky.app/',
+      'http://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      false,
+    ],
+    [
+      'https://bsky.app/',
+      'http://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      false,
+    ],
+    [
+      'http://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      'https://google.com',
+      true,
+    ],
+    [
+      'https://bsky.app/profile/bob.test/post/3kbeuduu7m22v',
+      'https://google.com',
+      true,
+    ],
+    ['http://bsky.app/', 'https://google.com', true],
+    ['https://bsky.app/', 'https://google.com', true],
 
     // bad uri inputs, default to true
     ['', '', true],