discourse-translator/spec/system/site_settings_validation_spec.rb
Natalie Tay bff13dbd61
UX: Prevent users from wondering why backfilling is not happening (#233)
Users are allowed to set `automatic translation target languages`, but the automatic translation depends on `automatic_translation_backfill_maximum_translations_per_hour`, and the latter is a hidden site setting defaulting to zero. It is not obvious that these settings are related.

This commit ensures users are informed that this needs to be set as well.
2025-02-27 19:03:21 +08:00

27 lines
761 B
Ruby

# frozen_string_literal: true
RSpec.describe "Translation settings", type: :system do
fab!(:admin)
before do
sign_in(admin)
SiteSetting.translator_enabled = true
end
it "warns when automatic_translation_target_languages is being set but backfill limit is 0" do
visit(
"/admin/plugins/discourse-translator/settings?filter=automatic%20translation%20target%20languages",
)
setting =
PageObjects::Components::SelectKit.new(
"[data-setting='automatic_translation_target_languages'] .select-kit",
)
setting.expand
setting.select_row_by_value("ja")
page.find(".setting-controls button.ok").click()
expect(page).to have_content(I18n.t("site_settings.errors.needs_nonzero_backfill"))
end
end