forked from getodk/central-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved createConflict() to a separate file
- Loading branch information
1 parent
cc7b970
commit 3fa659b
Showing
3 changed files
with
36 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const appRoot = require('app-root-path'); | ||
const { exhaust } = require(appRoot + '/lib/worker/worker'); | ||
const testData = require('../../data/xml'); | ||
|
||
const createConflict = async (user, container) => { | ||
await user.post('/v1/projects/1/forms/simpleEntity/submissions') | ||
.send(testData.instances.simpleEntity.one) | ||
.set('Content-Type', 'application/xml') | ||
.expect(200); | ||
|
||
await exhaust(container); | ||
|
||
await user.patch('/v1/projects/1/datasets/people/entities/12345678-1234-4123-8234-123456789abc?force=true') | ||
.send({ data: { age: '99' } }) | ||
.expect(200); | ||
|
||
await user.post('/v1/projects/1/forms?publish=true') | ||
.send(testData.forms.updateEntity) | ||
.set('Content-Type', 'application/xml') | ||
.expect(200); | ||
|
||
// all properties changed | ||
await user.post('/v1/projects/1/forms/updateEntity/submissions') | ||
.send(testData.instances.updateEntity.one) | ||
.set('Content-Type', 'application/xml') | ||
.expect(200); | ||
|
||
await exhaust(container); | ||
}; | ||
|
||
module.exports = { | ||
createConflict | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters