mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Add test case/Fix message
- Test that the rule is automatically created for new reviews - Improve English message
This commit is contained in:
parent
c05065f684
commit
e4aba5d4df
@ -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')
|
||||
})
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user