Robert Schäfer
c869724d29
Let all tests pass 💚
2019-03-04 18:41:05 +01:00
Robert Schäfer
b2520258a3
Improve specification of posts resolver
...
* only authors are alllowed to update/delete their own posts
* set disabled+deleted to false if not provided
2019-03-04 18:41:05 +01:00
Grzegorz Leoniec
cbf697c031
Merge remote-tracking branch 'origin/master' into distinct-shouts-and-follows
2019-03-04 17:37:23 +01:00
Grzegorz Leoniec
f39e27c47c
Added followedByCurrentUser and shoutedByCurrentUser
2019-03-03 19:29:40 +01:00
Grzegorz Leoniec
257183ac3f
added currentUserId to cypher params
2019-03-03 19:29:25 +01:00
Grzegorz Leoniec
83b36e8e35
Output distinct counts
2019-03-03 15:55:11 +01:00
Robert Schäfer
4a64755df7
Merge branch 'master' into 27_disable_posts
2019-03-03 15:27:27 +01:00
Robert Schäfer
8d1eb6026a
Let all tests pass 💚
2019-03-03 14:35:08 +01:00
Robert Schäfer
fb2b407be0
Extend @Tirokk 's test to Create and Update
2019-03-03 14:32:29 +01:00
Robert Schäfer
f25708875a
Refactor badges test
...
CC @Tirokk @grenzfrequence
* the top level block should correspond with the name of the resolver
* the block below should be `CreatePost` or `UpdatePost`
* the arguments of client.request are `query/mutation`, `variables` but
you passed in the `headers` which should go into `new
GraphQlClient(host, options)`
* re-use the very same mutation to avoid bugs in the tests
* use `await expect(someAsyncMethod).resolves.toEqual(expected)` style for
extra test assurance
2019-03-03 14:01:50 +01:00
Wolfgang Huß
6937c60ef8
Only admins are allowed to create badges
2019-03-01 15:49:11 +01:00
Matt Rider
5e592f666b
Write unit test badge creation
...
- for unauthenticated
- for authenticated admin
Co-authored-by: Wolfgang Huss <wolle.huss@pjannto.com>
2019-02-28 16:16:14 -03:00
Robert Schäfer
8febf147ce
Fix lint
2019-02-28 18:37:52 +01:00
Robert Schäfer
f3ab671f21
Soft delete middleware test passes
2019-02-28 18:37:52 +01:00
Robert Schäfer
911500a3bd
Don't override given { deleted, disabled } = args
...
@appinteractive I guess this was done unintentionally?
2019-02-28 18:37:52 +01:00
Robert Schäfer
738ba4f51c
DRY softDeleteMiddleware
2019-02-28 18:37:52 +01:00
Robert Schäfer
ce28de893b
Write a test for #27
...
Moderators are allowed to see disabled or deleted posts if they
ask for it.
2019-02-28 18:37:52 +01:00
Armin
ea2f6b7811
Extract HTTP Signature verify middleware
2019-02-28 03:44:57 +01:00
Armin
bb04ef0664
Refactoring
2019-02-28 03:43:44 +01:00
Armin
067371581d
Create article before shouting in test and add "shouted" step + disable send Create Activity when creating a post
2019-02-28 03:43:21 +01:00
Armin
14a57d1ebf
Refactoring + fixes
2019-02-27 15:44:01 +01:00
Armin
b76de03e28
ActivityPub now also usable standalone
2019-02-27 15:24:51 +01:00
Armin
25eef848f6
Fetch actorObject and lookup inbox before sending object + addCommentAuthor
2019-02-27 15:06:30 +01:00
Matt Rider
f9b60fa0b0
Fix lint
2019-02-27 08:10:20 -03:00
Robert Schäfer
5fd44230dd
Get rid of LoggedInUser graphql type
...
This was causing a lot of headache on the frontend. Now, there a single
source of truth. If you query `currentUser` you can overwrite your local
copy of the user and update the UI.
2019-02-27 11:08:13 +01:00
Armin
adb674b98d
Handle update, like, dislike and accept activities and also sending activities through the ActivityPub protocol + refactoring
2019-02-27 02:43:48 +01:00
Armin
9e5b6865b8
Create and send Post via ActivityPub inbox of the server
2019-02-26 17:17:42 +01:00
Armin
577157c505
Some fixes + refactoring + logic to receive sharedInboxEndpoints and to add new one
2019-02-26 17:11:41 +01:00
Robert Schäfer
69bf53e05e
Impplement currentUser query
...
* remove dead code (passport-jwt)
* refactor resolves to have a separate folder
* currentUser and login have the same response
2019-02-26 16:35:31 +01:00
Robert Schäfer
c4f15e626d
Fix lint and unblock port 4001
...
We have to specify the `yarn run test:cypress` in `.travis.yml` in the
Nitro-Web repo.
2019-02-26 00:46:14 +01:00
Armin
f74a45379f
Integrate ActivityPub into the Backend
2019-02-25 23:57:44 +01:00
Robert Schäfer
ec2b1050bc
Less redundancy and more consistency in factories
...
* use the same `relate` method for now
* use a capital letter for the model `user` instead of `User`
2019-02-25 21:28:30 +01:00
Robert Schäfer
c86658729e
Merge remote-tracking branch 'origin/master' into editor
2019-02-22 18:05:42 +01:00
Robert Schäfer
2e7e0579e4
Fix bug with id middleware
...
Ids are queried only for well known queries and mutations
2019-02-22 16:11:07 +01:00
Robert Schäfer
889818cd2d
Expose bug in Query { isLoggedin }
...
The idMiddleware was adding selection fields to the resolveInfo even if
the selection fields were empty. This caused a bug for each resolve
function including
```
{
isLoggedin
}
```
which does not have any additional curly braces after the query.
2019-02-22 15:21:23 +01:00
Robert Schäfer
5856e74b39
Fix yarn run db:reset
2019-02-22 14:13:03 +01:00
Matt Rider
4a43583c6b
Create abusive-user to report, PR review suggestions
2019-02-21 22:43:51 -03:00
Matt Rider
40c210a0ce
Start unit testing report feature
2019-02-21 21:13:30 -03:00
Robert Schäfer
eda2ea34fc
Incorporate @appinteractive's feedback
...
@appinteractive can we merge this soon?
2019-02-21 20:03:22 +01:00
Robert Schäfer
132dba04dd
Refactor tests with the new factory API
2019-02-21 16:06:13 +01:00
Robert Schäfer
aa07a2a616
Refactor Id Middleware
...
I found a way to cleanly request additional attributes in our
middleware. We can use this pattern if we e.g. require the author of
posts and comments to check if the user is the author and therefore
authorized to update or delete the post.
CC @mattwr18 @appinteractive @tirokk
2019-02-21 10:50:41 +01:00
Robert Schäfer
98983bb575
Fix lint
2019-02-21 10:32:07 +01:00
Robert Schäfer
91a13593dc
Provide a better interface for factories
...
You can now run graphql mutations *from the point of view* of a user.
@mattwr18 @Tirokk Do you have a better idea how to name the factory
builder?
2019-02-21 02:17:07 +01:00
Robert Schäfer
d4a999ee91
Configure factories#cleanDatabase easier
2019-02-21 00:27:26 +01:00
Robert Schäfer
4a1e06402a
Fix lint
2019-02-20 15:26:49 +01:00
Robert Schäfer
7abc1583dc
Implement + test unique slugs for user
...
I put the relevant line on categories and organizations too, but I
didn't test it separately. I could have tested it but found it
unnecessary repeating
2019-02-20 14:03:36 +01:00
Robert Schäfer
bfc5603fa8
All tests are passing!
2019-02-20 12:56:57 +01:00
Robert Schäfer
a61362b269
Fix slugify unit test with async mock functions
2019-02-20 11:48:06 +01:00
Robert Schäfer
ba26c0e188
Seed reported comments, posts and users
2019-02-20 11:36:50 +01:00
Robert Schäfer
3532b473ee
Choose another slug is green
2019-02-20 01:30:32 +01:00