Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

テストを実行するとIconのDEPRECATION WARNINGが出る #3

Open
2 tasks
takahashim opened this issue Feb 4, 2025 · 0 comments
Open
2 tasks
Labels
bug Something isn't working

Comments

@takahashim
Copy link

背景と修正の概要

こちらのgemを組み込んだ形でDecidimインスタンスのテストを実行すると、以下のような警告が出るようでした。

DEPRECATION WARNING: Icon facebook not found. Register it with 

        Decidim.icons.register(name: "facebook", icon: "facebook", category: "system", description: "", engine: :core)
       (called from oauth_icon at /Users/maki/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/bundler/gems/omniauth-cityos-dcp-0fd1f02e17f0/lib/omniauth/cityos_dcp_login/helpers/custom_omniauth_helper.rb:24)
DEPRECATION WARNING: Icon x not found. Register it with 

        Decidim.icons.register(name: "x", icon: "x", category: "system", description: "", engine: :core)
       (called from oauth_icon at /Users/maki/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/bundler/gems/omniauth-cityos-dcp-0fd1f02e17f0/lib/omniauth/cityos_dcp_login/helpers/custom_omniauth_helper.rb:24)
DEPRECATION WARNING: Icon google not found. Register it with 

        Decidim.icons.register(name: "google", icon: "google", category: "system", description: "", engine: :core)
       (called from oauth_icon at /Users/maki/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/bundler/gems/omniauth-cityos-dcp-0fd1f02e17f0/lib/omniauth/cityos_dcp_login/helpers/custom_omniauth_helper.rb:24)
DEPRECATION WARNING: Icon facebook not found. Register it with 

        Decidim.icons.register(name: "facebook", icon: "facebook", category: "system", description: "", engine: :core)
       (called from oauth_icon at /Users/maki/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/bundler/gems/omniauth-cityos-dcp-0fd1f02e17f0/lib/omniauth/cityos_dcp_login/helpers/custom_omniauth_helper.rb:24)
DEPRECATION WARNING: Icon x not found. Register it with 

        Decidim.icons.register(name: "x", icon: "x", category: "system", description: "", engine: :core)
       (called from oauth_icon at /Users/maki/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/bundler/gems/omniauth-cityos-dcp-0fd1f02e17f0/lib/omniauth/cityos_dcp_login/helpers/custom_omniauth_helper.rb:24)
DEPRECATION WARNING: Icon google not found. Register it with 

        Decidim.icons.register(name: "google", icon: "google", category: "system", description: "", engine: :core)

現在の状況

GitHub Actionsだと以下のようになります。

https://github.com/codeforjapan/decidim-cfj/actions/runs/13110282893/job/36572494144#step:13:61

確認環境

  • 発生バージョン: decidim-cfj: (rev. a24919489eb675eb445358379d4eb7002a9200af) + omniauth-cityos-dcp tag: v1.3.0 (rev. 0fd1f02e17f0444d798cc5aff4fd8fadbc4a8313)
  • 発生環境(ブラウザ、バージョン、OSなど): Mac Sequoia, rspec / ubuntu-latest, rspec

確認手順

decidim-cfjをclone + bundle installした後、以下を実行すると出るはずです。

$ bundle exec rspec ./spec/system/comment_sort_spec.rb

修正する内容

  • omniauth-cityos-dcpのどこか(おそらくlib/omniauth/cityos_dcp_login/engine.rbのinitializer等)に以下を追加すると出なくなるはずです
Decidim.icons.register(name: "facebook", icon: "facebook-fill", category: "system", description: "", engine: :core)
Decidim.icons.register(name: "x", icon: "x-fill", category: "system", description: "", engine: :core)
Decidim.icons.register(name: "google", icon: "google-fill", category: "system", description: "", engine: :core)

これはremixiconの名前がfoo-fillfoo-lineのような命名になっているため、それに合わせる必要があるのでした。
例: https://remixicon.com/icon/google-fill

修正確認の手順と期待する結果

  • bundle exec rspec ./spec/system/comment_sort_spec.rbを実行しても上記の警告が出なくなる
@takahashim takahashim added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant