Allow dashes in domain name search
[akkoma] / test / pleroma / html_test.exs
index 7d37568844915adae8a6f95b8e100a1bae7760ad..fe1a1ed5748f9dc01b1c5908fae0bdba4d10608a 100644 (file)
@@ -1,12 +1,12 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.HTMLTest do
   alias Pleroma.HTML
   alias Pleroma.Object
   alias Pleroma.Web.CommonAPI
-  use Pleroma.DataCase
+  use Pleroma.DataCase, async: true
 
   import Pleroma.Factory
 
@@ -175,7 +175,7 @@ defmodule Pleroma.HTMLTest do
             "I think I just found the best github repo https://github.com/komeiji-satori/Dress"
         })
 
-      object = Object.normalize(activity)
+      object = Object.normalize(activity, fetch: false)
       {:ok, url} = HTML.extract_first_external_url_from_object(object)
       assert url == "https://github.com/komeiji-satori/Dress"
     end
@@ -190,7 +190,7 @@ defmodule Pleroma.HTMLTest do
             "@#{other_user.nickname} install misskey! https://github.com/syuilo/misskey/blob/develop/docs/setup.en.md"
         })
 
-      object = Object.normalize(activity)
+      object = Object.normalize(activity, fetch: false)
       {:ok, url} = HTML.extract_first_external_url_from_object(object)
 
       assert url == "https://github.com/syuilo/misskey/blob/develop/docs/setup.en.md"
@@ -206,7 +206,7 @@ defmodule Pleroma.HTMLTest do
           status: "#cofe https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140"
         })
 
-      object = Object.normalize(activity)
+      object = Object.normalize(activity, fetch: false)
       {:ok, url} = HTML.extract_first_external_url_from_object(object)
 
       assert url == "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140"
@@ -222,7 +222,7 @@ defmodule Pleroma.HTMLTest do
           content_type: "text/html"
         })
 
-      object = Object.normalize(activity)
+      object = Object.normalize(activity, fetch: false)
       {:ok, url} = HTML.extract_first_external_url_from_object(object)
 
       assert url == "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140"
@@ -233,7 +233,7 @@ defmodule Pleroma.HTMLTest do
 
       {:ok, activity} = CommonAPI.post(user, %{status: "\"http://cofe.com/?boomer=ok&foo=bar\""})
 
-      object = Object.normalize(activity)
+      object = Object.normalize(activity, fetch: false)
 
       assert {:ok, nil} = HTML.extract_first_external_url_from_object(object)
     end
@@ -247,7 +247,7 @@ defmodule Pleroma.HTMLTest do
             "<a href=\"https://pleroma.gov/media/d24caa3a498e21e0298377a9ca0149a4f4f8b767178aacf837542282e2d94fb1.png?name=image.png\" class=\"attachment\">image.png</a>"
         })
 
-      object = Object.normalize(activity)
+      object = Object.normalize(activity, fetch: false)
 
       assert {:ok, nil} = HTML.extract_first_external_url_from_object(object)
     end