@openneuro/server 4.6.2 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/datalad/__tests__/dataset.spec.js +2 -4
- package/src/datalad/__tests__/pagination.spec.js +1 -2
- package/src/datalad/__tests__/snapshots.spec.js +1 -2
- package/src/graphql/__tests__/comment.spec.js +2 -4
- package/src/graphql/resolvers/__tests__/dataset.spec.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openneuro/server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "Core service for the OpenNeuro platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/server.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@apollo/client": "3.4.17",
|
|
20
20
|
"@elastic/elasticsearch": "7.15.0",
|
|
21
|
-
"@openneuro/search": "^4.
|
|
21
|
+
"@openneuro/search": "^4.7.0",
|
|
22
22
|
"@passport-next/passport-google-oauth2": "^1.0.0",
|
|
23
23
|
"@sentry/node": "^4.5.3",
|
|
24
24
|
"apollo-server": "2.25.3",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"babel-eslint": "^10.1.0",
|
|
90
90
|
"core-js": "^3.10.1",
|
|
91
91
|
"ioredis-mock": "^3.8.1",
|
|
92
|
-
"jest": "
|
|
92
|
+
"jest": "27.5.1",
|
|
93
93
|
"mockingoose": "2.11.0",
|
|
94
94
|
"nodemon": "^2.0.7",
|
|
95
95
|
"supertest": "^3.0.0",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "74336af513bf3128af43ad3c55e2127b3a85915b"
|
|
109
109
|
}
|
|
@@ -19,16 +19,15 @@ describe('dataset model operations', () => {
|
|
|
19
19
|
'findOne',
|
|
20
20
|
)
|
|
21
21
|
})
|
|
22
|
-
it('resolves to dataset id string', async
|
|
22
|
+
it('resolves to dataset id string', async () => {
|
|
23
23
|
const { id: dsId } = await createDataset(null, null, {
|
|
24
24
|
affirmedDefaced: true,
|
|
25
25
|
affirmedConsent: true,
|
|
26
26
|
})
|
|
27
27
|
expect(dsId).toHaveLength(8)
|
|
28
28
|
expect(dsId.slice(0, 2)).toBe('ds')
|
|
29
|
-
done()
|
|
30
29
|
})
|
|
31
|
-
it('posts to the DataLad /datasets/{dsId} endpoint', async
|
|
30
|
+
it('posts to the DataLad /datasets/{dsId} endpoint', async () => {
|
|
32
31
|
// Reset call count for request.post
|
|
33
32
|
request.post.mockClear()
|
|
34
33
|
const { id: dsId } = await createDataset(null, null, {
|
|
@@ -39,7 +38,6 @@ describe('dataset model operations', () => {
|
|
|
39
38
|
expect(request.post).toHaveBeenCalledWith(
|
|
40
39
|
expect.stringContaining(`${getDatasetWorker(dsId)}/datasets/`),
|
|
41
40
|
)
|
|
42
|
-
done()
|
|
43
41
|
})
|
|
44
42
|
})
|
|
45
43
|
describe('datasetsFilter()', () => {
|
|
@@ -56,14 +56,13 @@ describe('pagination model operations', () => {
|
|
|
56
56
|
'aggregate',
|
|
57
57
|
)
|
|
58
58
|
})
|
|
59
|
-
it('returns a connection shaped result', async
|
|
59
|
+
it('returns a connection shaped result', async () => {
|
|
60
60
|
const res = await pagination.datasetsConnection({
|
|
61
61
|
orderBy: { created: 'ascending' },
|
|
62
62
|
limit: 5,
|
|
63
63
|
})([])
|
|
64
64
|
expect(res).toHaveProperty('pageInfo')
|
|
65
65
|
expect(res).toHaveProperty('edges')
|
|
66
|
-
done()
|
|
67
66
|
})
|
|
68
67
|
})
|
|
69
68
|
describe('maxLimit()', () => {
|
|
@@ -31,7 +31,7 @@ describe('snapshot model operations', () => {
|
|
|
31
31
|
'findOne',
|
|
32
32
|
)
|
|
33
33
|
})
|
|
34
|
-
it('posts to the DataLad /datasets/{dsId}/snapshots/{snapshot} endpoint', async
|
|
34
|
+
it('posts to the DataLad /datasets/{dsId}/snapshots/{snapshot} endpoint', async () => {
|
|
35
35
|
const tag = 'snapshot'
|
|
36
36
|
const { id: dsId } = await createDataset(null, null, {
|
|
37
37
|
affirmedDefaced: true,
|
|
@@ -47,7 +47,6 @@ describe('snapshot model operations', () => {
|
|
|
47
47
|
`${getDatasetWorker(dsId)}/datasets/${dsId}/snapshots/${tag}`,
|
|
48
48
|
),
|
|
49
49
|
)
|
|
50
|
-
done()
|
|
51
50
|
})
|
|
52
51
|
})
|
|
53
52
|
})
|
|
@@ -17,7 +17,7 @@ describe('comment resolver helpers', () => {
|
|
|
17
17
|
let aId
|
|
18
18
|
let commentA
|
|
19
19
|
let adminUser, nonAdminUser
|
|
20
|
-
beforeEach(async
|
|
20
|
+
beforeEach(async () => {
|
|
21
21
|
mockingoose.resetAll()
|
|
22
22
|
adminUser = {
|
|
23
23
|
user: 'userid',
|
|
@@ -35,10 +35,9 @@ describe('comment resolver helpers', () => {
|
|
|
35
35
|
mockingoose.Comment.toReturn(commentA, 'findOne')
|
|
36
36
|
aId = (await Comment.findById('just getting commentA here').exec())._id
|
|
37
37
|
mockingoose.Comment.toReturn([], 'find')
|
|
38
|
-
done()
|
|
39
38
|
})
|
|
40
39
|
|
|
41
|
-
it('returns an array of the deleted comment ids', async
|
|
40
|
+
it('returns an array of the deleted comment ids', async () => {
|
|
42
41
|
const deletedIds = (
|
|
43
42
|
await deleteComment({}, { commentId: aId }, adminUser)
|
|
44
43
|
).map(id => id.toString())
|
|
@@ -46,7 +45,6 @@ describe('comment resolver helpers', () => {
|
|
|
46
45
|
// mockingoose ids are sequential, and the documents returned from each query get new ids for some reason
|
|
47
46
|
// TODO: Replace mockingoose with better library
|
|
48
47
|
expect(deletedIds[0].slice(-5)).toEqual(incrementHex(aId).slice(-5))
|
|
49
|
-
done()
|
|
50
48
|
})
|
|
51
49
|
|
|
52
50
|
it('prevents non-admin users from deleting comments', () => {
|
|
@@ -16,14 +16,13 @@ describe('dataset resolvers', () => {
|
|
|
16
16
|
)
|
|
17
17
|
})
|
|
18
18
|
describe('createDataset()', () => {
|
|
19
|
-
it('createDataset mutation succeeds', async
|
|
19
|
+
it('createDataset mutation succeeds', async () => {
|
|
20
20
|
const { id: dsId } = await ds.createDataset(
|
|
21
21
|
null,
|
|
22
22
|
{ affirmedDefaced: true, affirmedConsent: false },
|
|
23
23
|
{ user: '123456', userInfo: {} },
|
|
24
24
|
)
|
|
25
25
|
expect(dsId).toEqual(expect.stringMatching(/^ds[0-9]{6}$/))
|
|
26
|
-
done()
|
|
27
26
|
})
|
|
28
27
|
})
|
|
29
28
|
describe('snapshotCreationComparison()', () => {
|