Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pubsweet
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Tremblay McLellan
pubsweet
Commits
b84b369b
Commit
b84b369b
authored
6 years ago
by
Jure
Browse files
Options
Downloads
Patches
Plain Diff
fix(server): use TeamInput for updateTeam mutation too
parent
2c2d0778
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/server/src/graphql/definitions/team.js
+1
-1
1 addition, 1 deletion
packages/server/src/graphql/definitions/team.js
packages/server/test/graphql/mutations_test.js
+27
-0
27 additions, 0 deletions
packages/server/test/graphql/mutations_test.js
with
28 additions
and
1 deletion
packages/server/src/graphql/definitions/team.js
+
1
−
1
View file @
b84b369b
...
...
@@ -34,7 +34,7 @@ const typeDefs = `
extend type Mutation {
createTeam(input: TeamInput): Team
deleteTeam(id: ID): Team
updateTeam(id: ID, input:
String
): Team
updateTeam(id: ID, input:
TeamInput
): Team
}
type Team {
...
...
This diff is collapsed.
Click to expand it.
packages/server/test/graphql/mutations_test.js
+
27
−
0
View file @
b84b369b
const
User
=
require
(
'
../../src/models/User
'
)
const
Team
=
require
(
'
../../src/models/Team
'
)
const
cleanDB
=
require
(
'
../helpers/db_cleaner
'
)
const
fixtures
=
require
(
'
../fixtures/fixtures
'
)
const
api
=
require
(
'
../helpers/api
'
)
...
...
@@ -7,9 +8,12 @@ const authentication = require('../../src/authentication')
describe
(
'
GraphQL core mutations
'
,
()
=>
{
let
token
let
user
let
team
beforeEach
(
async
()
=>
{
await
cleanDB
()
user
=
await
new
User
(
fixtures
.
adminUser
).
save
()
team
=
await
new
Team
(
fixtures
.
readerTeam
).
save
()
token
=
authentication
.
token
.
create
(
user
)
})
...
...
@@ -111,6 +115,29 @@ describe('GraphQL core mutations', () => {
})
})
it
(
'
can update a team
'
,
async
()
=>
{
const
{
body
}
=
await
api
.
graphql
.
query
(
`mutation($id: ID, $input: TeamInput) {
updateTeam(id: $id, input: $input) { name }
}`
,
{
id
:
team
.
id
,
input
:
{
name
:
'
Updated Team
'
,
},
},
token
,
)
expect
(
body
).
toEqual
({
data
:
{
updateTeam
:
{
name
:
'
Updated Team
'
,
},
},
})
})
it
(
'
sets owners when creating a collection
'
,
async
()
=>
{
const
{
body
}
=
await
api
.
graphql
.
query
(
`mutation($input: CollectionInput) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment