0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-24 10:20:28 +01:00
discourse-custom-wizard/spec/components/discourse_plugin_statistics/plugin_spec.rb

84 Zeilen
2,1 KiB
Ruby

# frozen_string_literal: true
describe DiscoursePluginStatistics::Plugin do
let(:template_json) { get_wizard_fixture("wizard") }
describe "#discourse_custom_wizard" do
before do
2024-10-16 13:52:03 +02:00
enable_subscription("standard")
CustomWizard::Template.save(template_json, skip_jobs: true)
template_json_2 = template_json.dup
2024-10-16 13:52:03 +02:00
template_json_2["id"] = "super_mega_fun_wizard_2"
CustomWizard::Template.save(template_json_2, skip_jobs: true)
@data = DiscoursePluginStatistics::Plugin.discourse_custom_wizard
end
it "includes a total wizard count" do
expect(@data[:total_wizards]).to eq(2)
end
it "includes the subscription type" do
2024-10-16 13:52:03 +02:00
expect(@data[:subscription_type]).to eq("standard")
end
it "includes a count of features being used across all wizards" do
expect(@data[:subscription_features]).to eq(
wizard: {
save_submissions: 2,
after_signup: 2,
prompt_completion: 2,
required: 0,
permitted: 0,
},
step: {
required_data: 0,
permitted_params: 0,
2024-10-16 13:52:03 +02:00
force_final: 0,
},
field: {
condition: 0,
type: {
text: 2,
textarea: 2,
text_only: 2,
date: 2,
time: 2,
date_time: 2,
number: 2,
checkbox: 2,
dropdown: 2,
composer: 0,
composer_preview: 0,
url: 0,
upload: 0,
tag: 0,
category: 0,
group: 0,
2024-06-20 13:06:02 +02:00
topic: 0,
user_selector: 0,
},
2024-10-16 13:52:03 +02:00
realtime_validations: 0,
},
action: {
type: {
create_topic: 2,
send_message: 0,
update_profile: 2,
open_composer: 2,
route_to: 2,
send_to_api: 0,
watch_categories: 0,
watch_tags: 0,
add_to_group: 0,
create_group: 0,
create_category: 0,
2024-10-16 13:52:03 +02:00
},
},
)
end
end
end