2024-01-02 17:23:41 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-10-24 20:15:32 +08:00
|
|
|
describe "Post menu", type: :system do
|
2024-01-02 17:23:41 +08:00
|
|
|
fab!(:current_user) { Fabricate(:user) }
|
2024-01-03 14:55:08 +08:00
|
|
|
fab!(:topic)
|
|
|
|
fab!(:post) { Fabricate(:post, topic: topic) }
|
2024-01-02 17:23:41 +08:00
|
|
|
|
|
|
|
let(:topic_page) { PageObjects::Pages::Topic.new }
|
|
|
|
|
|
|
|
before { sign_in(current_user) }
|
|
|
|
|
|
|
|
describe "copy link" do
|
|
|
|
let(:cdp) { PageObjects::CDP.new }
|
|
|
|
|
|
|
|
before { cdp.allow_clipboard }
|
|
|
|
|
2024-01-03 14:55:08 +08:00
|
|
|
it "copies the absolute link to the post when clicked" do
|
2024-01-02 17:23:41 +08:00
|
|
|
topic_page.visit_topic(post.topic)
|
|
|
|
topic_page.click_post_action_button(post, :copy_link)
|
2024-07-19 19:44:10 +08:00
|
|
|
cdp.clipboard_has_text?(post.full_url(share_url: true) + "?u=#{current_user.username}")
|
2024-01-02 17:23:41 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|