forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic end-to-end test for admin moderation interface (mastodon#29424
- Loading branch information
1 parent
2661388
commit 9d06b4b
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe 'report interface', :paperclip_processing do | ||
include ProfileStories | ||
|
||
let(:email) { 'admin@example.com' } | ||
let(:password) { 'password' } | ||
let(:confirmed_at) { Time.zone.now } | ||
let(:finished_onboarding) { true } | ||
|
||
let(:reported_account) { Fabricate(:account) } | ||
let(:reported_status) { Fabricate(:status, account: reported_account) } | ||
let(:media_attachment) { Fabricate(:media_attachment, account: reported_account, status: reported_status, file: attachment_fixture('attachment.jpg')) } | ||
let!(:report) { Fabricate(:report, target_account: reported_account, status_ids: [media_attachment.status.id]) } | ||
|
||
before do | ||
as_a_logged_in_admin | ||
visit admin_report_path(report) | ||
end | ||
|
||
it 'displays the report interface, including the javascript bits' do | ||
# The report category selector React component is properly rendered | ||
expect(page).to have_css('.report-reason-selector') | ||
|
||
# The media React component is properly rendered | ||
page.scroll_to(page.find('.batch-table__row')) | ||
expect(page).to have_css('.spoiler-button__overlay__label') | ||
end | ||
end |