Repurpose report post modal and re-use for list reporting (#1070)

*  Repupose report post modal and re-use for list reporting

*  Allow reporting a feed generator

*  ♻️ Refactor report modal into one shared component for reporting different collections

*  Adjust report option selector in tests

*  Add test for list reporting

* ♻️  Refactor reason options and add options for list and feedgen

* 🧹 Cleanup remaining todo

* Fix to mutelist react keys

* Fix regression from rebase

* Improve customfeed mobile header

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
Foysal Ahamed 2023-08-15 23:32:06 +02:00 committed by GitHub
parent a5762c2d7d
commit abbc6543f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 354 additions and 363 deletions

View file

@ -125,12 +125,12 @@ describe('Profile screen', () => {
it('Can report another user', async () => {
await element(by.id('profileHeaderDropdownBtn')).tap()
await element(by.text('Report Account')).tap()
await expect(element(by.id('reportAccountModal'))).toBeVisible()
await expect(element(by.id('reportModal'))).toBeVisible()
await element(
by.id('reportAccountRadios-com.atproto.moderation.defs#reasonSpam'),
by.id('reportReasonRadios-com.atproto.moderation.defs#reasonSpam'),
).tap()
await element(by.id('sendReportBtn')).tap()
await expect(element(by.id('reportAccountModal'))).not.toBeVisible()
await expect(element(by.id('reportModal'))).not.toBeVisible()
})
it('Can like posts', async () => {
@ -173,11 +173,11 @@ describe('Profile screen', () => {
const posts = by.id('feedItem-by-bob.test')
await element(by.id('postDropdownBtn').withAncestor(posts)).atIndex(0).tap()
await element(by.text('Report post')).tap()
await expect(element(by.id('reportPostModal'))).toBeVisible()
await expect(element(by.id('reportModal'))).toBeVisible()
await element(
by.id('reportPostRadios-com.atproto.moderation.defs#reasonSpam'),
by.id('reportReasonRadios-com.atproto.moderation.defs#reasonSpam'),
).tap()
await element(by.id('sendReportBtn')).tap()
await expect(element(by.id('reportPostModal'))).not.toBeVisible()
await expect(element(by.id('reportModal'))).not.toBeVisible()
})
})