diff --git a/backend/src/schema/resolvers/reports.spec.js b/backend/src/schema/resolvers/reports.spec.js index 648f55688..e4fb32ec8 100644 --- a/backend/src/schema/resolvers/reports.spec.js +++ b/backend/src/schema/resolvers/reports.spec.js @@ -23,6 +23,7 @@ describe('file a report on a resource', () => { updatedAt disable closed + rule resource { __typename ... on User { @@ -151,6 +152,20 @@ describe('file a report on a resource', () => { expect(firstReport.data.fileReport.id).toEqual(secondReport.data.fileReport.id) }) + it('returns the rule for how the report was decided', async () => { + await expect(mutate({ + mutation: reportMutation, + variables: { ...variables, resourceId: 'abusive-user-id' }, + }), + ).resolves.toMatchObject({ + data: { + fileReport: { + rule: 'latestReviewUpdatedAtRules' + }, + }, + errors: undefined, + }) + }) it.todo('creates multiple filed reports') }) diff --git a/neo4j/change_disabled_relationship_to_report_node.sh b/neo4j/change_disabled_relationship_to_report_node.sh index 55dd1333c..2f44b8e59 100755 --- a/neo4j/change_disabled_relationship_to_report_node.sh +++ b/neo4j/change_disabled_relationship_to_report_node.sh @@ -29,7 +29,7 @@ WITH moderator, disabledResource, report OPTIONAL MATCH (disabledResourceReporter:User)-[existingFiledReport:FILED]->(disabledResource) FOREACH(disabledResource IN CASE WHEN existingFiledReport IS NULL THEN [1] ELSE [] END | CREATE (moderator)-[addModeratorReport:FILED]->(report) - SET addModeratorReport.createdAt = toString(datetime()), addModeratorReport.reasonCategory = 'other', addModeratorReport.reasonDescription = 'Old DISABLED relation had no now mandatory report !!! Created automatically to ensure database consistency! Creation date is when the database manipulation happened.' + SET addModeratorReport.createdAt = toString(datetime()), addModeratorReport.reasonCategory = 'other', addModeratorReport.reasonDescription = 'Old DISABLED relations didn't enforce mandatory reporting !!! Created automatically to ensure database consistency! Creation date is when the database manipulation happened.' ) FOREACH(disabledResource IN CASE WHEN existingFiledReport IS NOT NULL THEN [1] ELSE [] END | CREATE (disabledResourceReporter)-[moveModeratorReport:FILED]->(report)