mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Ensure do-not-disturb icon updates correctly (#28253)
`currentUser.do_not_disturb_until` is a string, so we need to parse it before comparing to the current timestamp
This commit is contained in:
@@ -300,5 +300,20 @@ 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 and hides do-not-disturb icon" do
|
||||
sign_in current_user
|
||||
visit "/"
|
||||
|
||||
header = find(".d-header")
|
||||
expect(header).not_to have_css(".do-not-disturb-background")
|
||||
|
||||
current_user.publish_do_not_disturb(ends_at: 1.hour.from_now)
|
||||
expect(header).to have_css(".d-header .do-not-disturb-background")
|
||||
|
||||
current_user.publish_do_not_disturb(ends_at: 1.second.from_now)
|
||||
|
||||
expect(header).not_to have_css(".d-header .do-not-disturb-background")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user