Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanvidrine committed Nov 8, 2024
1 parent 3a0c11d commit b16d4a2
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion spec/system/post_event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
describe "Post event", type: :system do
fab!(:admin)
fab!(:user) { Fabricate(:admin, username: "jane") }
fab!(:group) { Fabricate(:group, name: "test_group") }
let(:composer) { PageObjects::Components::Composer.new }

before do
SiteSetting.calendar_enabled = true
SiteSetting.discourse_post_event_enabled = true
SiteSetting.discourse_post_event_allowed_custom_fields = "custom"
sign_in(admin)
end

Expand Down Expand Up @@ -69,4 +71,35 @@

expect(event.invitees.count).to eq(2)
end
end

it "can update fields and invitees and they are kept when re-opening" do
visit "/new-topic"
title = "Test event with updates"

composer.fill_title(title)

page.find(".toolbar-popup-menu-options .dropdown-select-box-header").click

page.find(
".toolbar-popup-menu-options [data-name='#{I18n.t("js.discourse_post_event.builder_modal.attach")}']",
).click

page.find(".d-modal input[name=status][value=private]").click

page.find(".d-modal input.group-selector").fill_in(with: "test_")
page.find(".autocomplete.ac-group").click

page.find(".d-modal .custom-field-input").fill_in(with: "custom value")

page.find(".d-modal .btn-primary").click

composer.submit

page.find(".discourse-post-event-more-menu-trigger").click
page.find(".edit-event").click

expect(page.find(".d-modal input[name=status][value=private]").checked?).to eq(true)
expect(page.find(".d-modal")).to have_text("test_group")
expect(page.find(".d-modal .custom-field-input").value).to eq("custom value")
end
end

0 comments on commit b16d4a2

Please sign in to comment.