]> git.openstreetmap.org Git - rails.git/blobdiff - test/helpers/browse_tags_helper_test.rb
Remove some tag table custom css
[rails.git] / test / helpers / browse_tags_helper_test.rb
index f9f977c4986026206e433f480002fb74c34d5312..0af0d931018ee7c25928f80ad4ac6f025cb0cb1a 100644 (file)
@@ -48,7 +48,7 @@ class BrowseTagsHelperTest < ActionView::TestCase
     assert_dom_equal "<a title=\"The File:Test.jpg item on Wikimedia Commons\" href=\"//commons.wikimedia.org/wiki/File:Test.jpg?uselang=en\">File:Test.jpg</a>", html
 
     html = format_value("colour", "#f00")
-    assert_dom_equal %(<span class="colour-preview-box" data-colour="#f00" title="Colour #f00 preview"></span>#f00), html
+    assert_dom_equal %(<span class="colour-preview-box float-end m-1 border border-dark border-opacity-10" data-colour="#f00" title="Colour #f00 preview"></span>#f00), html
 
     html = format_value("email", "foo@example.com")
     assert_dom_equal "<a title=\"Email foo@example.com\" href=\"mailto:foo@example.com\">foo@example.com</a>", html
@@ -132,6 +132,10 @@ class BrowseTagsHelperTest < ActionView::TestCase
     assert_equal "//www.wikidata.org/entity/Q24?uselang=en", links[0][:url]
     assert_equal "Q24", links[0][:title]
 
+    links = wikidata_links("species:wikidata", "Q26899")
+    assert_equal "//www.wikidata.org/entity/Q26899?uselang=en", links[0][:url]
+    assert_equal "Q26899", links[0][:title]
+
     # Another allowed key, this time with multiple values and I18n
     I18n.with_locale "dsb" do
       links = wikidata_links("brand:wikidata", "Q936;Q2013;Q1568346")
@@ -194,6 +198,10 @@ class BrowseTagsHelperTest < ActionView::TestCase
       assert_equal "zh-classical:Test#Section", link[:title]
     end
 
+    link = wikipedia_link("subject:wikipedia", "en:Catherine McAuley")
+    assert_equal "https://en.wikipedia.org/wiki/en:Catherine McAuley?uselang=en", link[:url]
+    assert_equal "en:Catherine McAuley", link[:title]
+
     link = wikipedia_link("foo", "Test")
     assert_nil link
   end