mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 03:30:38 +08:00
The recent commit (6a7825baf3) that added local date support in poll
options introduced a static import from the discourse-local-dates
plugin. This caused the poll plugin to blow up during initialization
when local-dates was disabled, since the module simply doesn't exist in
that case.
Switched to using `optionalRequire` which safely checks if the module is
available before loading it. This is the same pattern already used by
chat-composer and the core local-dates helper for cross-plugin
dependencies.
17 lines
420 B
Ruby
17 lines
420 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Poll UI Builder" do
|
|
it "loads when local-dates plugin is disabled" do
|
|
SiteSetting.discourse_local_dates_enabled = false
|
|
|
|
visit "/"
|
|
|
|
errors =
|
|
$playwright_logger.logs.select do |log|
|
|
log[:level] == "error" &&
|
|
log[:message].include?("/discourse-local-dates/lib/generate-current-date-markup")
|
|
end
|
|
|
|
expect(errors).to be_empty
|
|
end
|
|
end
|