Skip to content

A platform for community discussion. Free, open, simple.

DEV: fix flakeyness with drawer specs (#22476)

Joffrey JAFFEUXf0d82de5d93d
diff --git a/app/assets/javascripts/discourse/app/lib/url.js b/app/assets/javascripts/discourse/app/lib/url.js
index 492d5027a26..7864a0d1fac 100644
--- a/app/assets/javascripts/discourse/app/lib/url.js
+++ b/app/assets/javascripts/discourse/app/lib/url.js
@@ -464,7 +464,7 @@ const DiscourseURL = EmberObject.extend({
transition._discourse_original_url = path;
const promise = transition.promise || transition;
- promise.then(() => this.jumpToElement(elementId));
+ return promise.then(() => this.jumpToElement(elementId));
},
jumpToElement(elementId) {
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js
index 04c9f32de3c..e746dde30fc 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js
@@ -825,13 +825,8 @@ export default class ChatLivePane extends Component {
onCloseFullScreen() {
this.chatStateManager.prefersDrawer();
- DiscourseURL.routeTo(this.chatStateManager.lastKnownAppURL, {
- afterRouteComplete: () => {
- this.appEvents.trigger(
- "chat:open-url",
- this.chatStateManager.lastKnownChatURL
- );
- },
+ DiscourseURL.routeTo(this.chatStateManager.lastKnownAppURL).then(() => {
+ DiscourseURL.routeTo(this.chatStateManager.lastKnownChatURL);
});
}
diff --git a/plugins/chat/spec/system/navigation_spec.rb b/plugins/chat/spec/system/navigation_spec.rb
index d739c55bd49..4e318044c94 100644
--- a/plugins/chat/spec/system/navigation_spec.rb
+++ b/plugins/chat/spec/system/navigation_spec.rb
@@ -120,7 +120,7 @@ RSpec.describe "Navigation", type: :system do
end
context "when collapsing full page with previous state" do
- xit "redirects to previous state" do
+ it "redirects to previous state" do
visit("/t/-/#{topic.id}")
chat_page.open_from_header
chat_drawer_page.maximize