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
|
updatedAt
|
||||||
disable
|
disable
|
||||||
closed
|
closed
|
||||||
|
rule
|
||||||
resource {
|
resource {
|
||||||
__typename
|
__typename
|
||||||
... on User {
|
... on User {
|
||||||
@ -151,6 +152,20 @@ describe('file a report on a resource', () => {
|
|||||||
expect(firstReport.data.fileReport.id).toEqual(secondReport.data.fileReport.id)
|
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')
|
it.todo('creates multiple filed reports')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ WITH moderator, disabledResource, report
|
|||||||
OPTIONAL MATCH (disabledResourceReporter:User)-[existingFiledReport:FILED]->(disabledResource)
|
OPTIONAL MATCH (disabledResourceReporter:User)-[existingFiledReport:FILED]->(disabledResource)
|
||||||
FOREACH(disabledResource IN CASE WHEN existingFiledReport IS NULL THEN [1] ELSE [] END |
|
FOREACH(disabledResource IN CASE WHEN existingFiledReport IS NULL THEN [1] ELSE [] END |
|
||||||
CREATE (moderator)-[addModeratorReport:FILED]->(report)
|
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 |
|
FOREACH(disabledResource IN CASE WHEN existingFiledReport IS NOT NULL THEN [1] ELSE [] END |
|
||||||
CREATE (disabledResourceReporter)-[moveModeratorReport:FILED]->(report)
|
CREATE (disabledResourceReporter)-[moveModeratorReport:FILED]->(report)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user