mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:08:32 +08:00
FIX: Improve topic/header integration when navigating away (#28040)
- Ensure main title is set as 'not visible' when removed from DOM - `deactivate` -> `willTransition` to ensure proper behavior when navigating between multiple topics Followup to bdec564d1417c51ef6958784fdd6375fd05da4fc
This commit is contained in:
@ -262,7 +262,7 @@ RSpec.describe "Glimmer Header", type: :system do
|
||||
|
||||
describe "mobile topic-info" do
|
||||
fab!(:topic)
|
||||
fab!(:posts) { Fabricate.times(5, :post, topic: topic) }
|
||||
fab!(:posts) { Fabricate.times(21, :post, topic: topic) }
|
||||
|
||||
it "only shows when scrolled down", mobile: true do
|
||||
visit "/t/#{topic.slug}/#{topic.id}"
|
||||
@ -286,5 +286,19 @@ RSpec.describe "Glimmer Header", type: :system do
|
||||
expect(page).not_to have_css("header.d-header .auth-buttons .login-button") # No header buttons
|
||||
expect(page).to have_css("header.d-header .title-wrapper .topic-link") # Title is shown in header
|
||||
end
|
||||
|
||||
it "shows when jumping from OP to much later post", mobile: true do
|
||||
visit "/t/#{topic.slug}/#{topic.id}"
|
||||
|
||||
expect(page).to have_css("#topic-title") # Main topic title
|
||||
expect(page).to have_css("header.d-header .auth-buttons .login-button") # header buttons visible when no topic-info in header
|
||||
|
||||
page.execute_script("Discourse.visit('/t/#{topic.slug}/#{topic.id}/21');")
|
||||
|
||||
expect(page).to have_css("#post_21")
|
||||
|
||||
expect(page).not_to have_css("header.d-header .auth-buttons .login-button") # No header buttons
|
||||
expect(page).to have_css("header.d-header .title-wrapper .topic-link") # Title is shown in header
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user