Skip to content

Commit

Permalink
FIX: Update flaky test in showing error modal (#228)
Browse files Browse the repository at this point in the history
the error:

```
Randomized with seed 43756
.F

Failures:

  1) Create channel shows error in chanel modal
     Failure/Error: super

     Capybara::ElementNotFound:
       Unable to find css ".error-message"

     [Screenshot Image]: /var/www/discourse/tmp/capybara/failures_r_spec_example_groups_create_channel_shows_error_in_chanel_modal_523.png

     ~~~~~~~ JS LOGS ~~~~~~~
     (no logs)
```

To try solving this, I've changed the ordering, before visiting the page I already set up the channel error.
  • Loading branch information
Grubba27 authored Oct 29, 2024
1 parent b2d9ad3 commit ac91fe0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/system/create_channel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@
expect(find(".channel-info")).to have_content("bloop")
end

it "shows error in chanel modal" do
it "shows the error in the channel modal" do
DiscourseChatIntegration::Rule.create!(
channel: chan1,
filter: "watch",
category_id: category.id,
)

visit("/admin/plugins/chat-integration/dummy")

provider.set_raise_exception(
DiscourseChatIntegration::ProviderError.new info: { error_key: "hello" }
)
manager.trigger_notifications(first_post.id)

visit("/admin/plugins/chat-integration/dummy")

expect(find(".error-message")).to have_content(
I18n.t("js.chat_integration.channels_with_errors"),
)

find(".channel-title").find("button").click
expect(page).to have_content "{\n \"error_key\": \"hello\"\n}"
end
Expand Down

0 comments on commit ac91fe0

Please sign in to comment.