FIX: ensures bulk-select is correctly working on mobile (#27290)

Prior to this fix we were opening a modal before closing the `DMenu` modal, given `DModal` expects only one modal at a time it was closing the latest modal and instantly closing the one we just opened.
This commit is contained in:
Joffrey JAFFEUX 2024-06-03 02:03:57 +02:00 committed by GitHub
parent 62b1b69e82
commit 510c022131
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 5 deletions

View File

@ -167,7 +167,9 @@ export default class BulkSelectTopicsDropdown extends Component {
} }
@action @action
onSelect(id) { async onSelect(id) {
await this.dMenu.close();
switch (id) { switch (id) {
case "update-category": case "update-category":
this.showBulkTopicActionsModal(id, "change_category", { this.showBulkTopicActionsModal(id, "change_category", {
@ -225,8 +227,6 @@ export default class BulkSelectTopicsDropdown extends Component {
}); });
} }
} }
this.dMenu.close();
} }
@action @action

View File

@ -11,11 +11,11 @@ module PageObjects
end end
def has_bulk_select_button? def has_bulk_select_button?
page.has_css?("#{TOPIC_LIST_HEADER_SELECTOR} button.bulk-select") page.has_css?(".bulk-select")
end end
def click_bulk_select_button def click_bulk_select_button
find("#{TOPIC_LIST_HEADER_SELECTOR} button.bulk-select").click find(".bulk-select").click
end end
def has_bulk_select_topics_dropdown? def has_bulk_select_topics_dropdown?

View File

@ -35,6 +35,14 @@ describe "Topic bulk select", type: :system do
expect(topic_bulk_actions_modal).to be_open expect(topic_bulk_actions_modal).to be_open
end end
context "when in mobile", mobile: true do
it "is working" do
# behavior is already tested on desktop, we simply ensure
# the general workflow is working on mobile
open_append_modal
end
end
it "appends tags to selected topics" do it "appends tags to selected topics" do
open_append_modal open_append_modal