FIX: redirects to browse after removing last followed (#22563)

Prior to this change you might end up in a loop where removing a channel would redirect you to this channel and as we auto-follow opened direct message channels, you could never unfollow this last direct message channel.
This commit is contained in:
Joffrey JAFFEUX
2023-07-14 08:26:18 +02:00
committed by GitHub
parent 10d155ea41
commit ef21450be7
3 changed files with 60 additions and 2 deletions

View File

@ -27,11 +27,17 @@ module PageObjects
end
def open_channel(channel)
find(".sidebar-section-link[href='/chat/c/#{channel.slug}/#{channel.id}']").click
find(".sidebar-section-link.channel-#{channel.id}").click
end
def remove_channel(channel)
selector = ".sidebar-section-link.channel-#{channel.id}"
find(selector).hover
find(selector + " .sidebar-section-hover-button").click
end
def find_channel(channel)
find(".sidebar-section-link[href='/chat/c/#{channel.slug}/#{channel.id}']")
find(".sidebar-section-link.channel-#{channel.id}")
self
end
end