This commit is contained in:
Wolfgang Huß 2020-04-09 11:16:28 +02:00
parent bd0cde685b
commit afe2c74bba
2 changed files with 2 additions and 30 deletions

View File

@ -1,28 +0,0 @@
#!/usr/bin/env bash
ENV_FILE=$(dirname "$0")/.env
[[ -f "$ENV_FILE" ]] && source "$ENV_FILE"
if [ -z "$NEO4J_USERNAME" ] || [ -z "$NEO4J_PASSWORD" ]; then
echo "Please set NEO4J_USERNAME and NEO4J_PASSWORD environment variables."
echo "Database manipulation is not possible without connecting to the database."
echo "E.g. you could \`cp .env.template .env\` unless you run the script in a docker container"
fi
until echo 'RETURN "Connection successful" as info;' | cypher-shell
do
echo "Connecting to neo4j failed, trying again..."
sleep 1
done
echo "
:begin
MATCH (submitter:User)-[filed:FILED]->(report:Report)
WHERE NOT (submitter)<-[:NOTIFIED]-(report)
CREATE (submitter)<-[notification:NOTIFIED]-(report)
SET notification.createdAt = filed.createdAt,
notification.updatedAt = notification.createdAt,
notification.read = FALSE,
notification.reason = 'filed_report_on_resource';
:commit
" | cypher-shell

View File

@ -74,12 +74,12 @@ describe('NotificationList.vue', () => {
wrapper = Wrapper()
})
describe("emit 'read', like as clicked on a notification", () => {
describe("emit 'read' like as clicked on a notification", () => {
beforeEach(() => {
wrapper.find(Notification).vm.$emit('read')
})
it("emits 'markAsRead' with the id of the notification source, if 'read' was emited", () => {
it("emits 'markAsRead' with the id of the notification source if 'read' was emited", () => {
expect(wrapper.emitted('markAsRead')[0]).toEqual(['post-1'])
})
})