Add test case/Fix message

- Test that the rule is automatically created for new reviews
- Improve English message
This commit is contained in:
mattwr18 2019-12-02 13:56:44 +01:00
parent c05065f684
commit e4aba5d4df
2 changed files with 16 additions and 1 deletions

View File

@ -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')
})

View File

@ -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)