Skip to content

Commit

Permalink
Added test data for entity updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuite committed Sep 26, 2023
1 parent cce1b97 commit 89c6b6c
Showing 1 changed file with 69 additions and 1 deletion.
70 changes: 69 additions & 1 deletion test/data/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,28 @@ module.exports = {
</h:head>
</h:html>`,

updateEntity: `<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:entities="http://www.opendatakit.org/xforms">
<h:head>
<model entities:entities-version="2022.1.0">
<instance>
<data id="updateEntity" orx:version="1.0">
<name/>
<age/>
<hometown/>
<meta>
<entity dataset="people" id="" update="" baseVersion="">
<label/>
</entity>
</meta>
</data>
</instance>
<bind nodeset="/data/name" type="string" entities:saveto="first_name"/>
<bind nodeset="/data/age" type="int" entities:saveto="age"/>
</model>
</h:head>
</h:html>`,

groupRepeat: `<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
Expand Down Expand Up @@ -649,6 +671,52 @@ module.exports = {
<q4>d</q4>
</data>`,
},
updateEntity: {
one: `<data xmlns:jr="http://openrosa.org/javarosa" xmlns:entities="http://www.opendatakit.org/xforms" id="updateEntity" version="1.0">
<meta>
<instanceID>one</instanceID>
<orx:instanceName>one</orx:instanceName>
<entity dataset="people" id="12345678-1234-4123-8234-123456789abc" baseVersion="1" update="1">
<label>Alicia (85)</label>
</entity>
</meta>
<name>Alicia</name>
<age>85</age>
</data>`,
two: `<data xmlns:jr="http://openrosa.org/javarosa" xmlns:entities="http://www.opendatakit.org/xforms" id="updateEntity" version="1.0">
<meta>
<instanceID>one</instanceID>
<orx:instanceName>one</orx:instanceName>
<entity dataset="people" id="12345678-1234-4123-8234-123456789aaa" baseVersion="1" update="1">
<label>Julie (30)</label>
</entity>
</meta>
<name>Julie</name>
<age>30</age>
</data>`,
three: `<data xmlns:jr="http://openrosa.org/javarosa" xmlns:entities="http://www.opendatakit.org/xforms" id="updateEntity" version="1.0">
<meta>
<instanceID>one</instanceID>
<orx:instanceName>one</orx:instanceName>
<entity dataset="people" id="12345678-1234-4123-8234-123456789bbb" baseVersion="1" update="1">
<label>Jonathan</label>
</entity>
</meta>
<name>Jonathan</name>
<age></age>
</data>`,
four: `<data xmlns:jr="http://openrosa.org/javarosa" xmlns:entities="http://www.opendatakit.org/xforms" id="updateEntity" version="1.0">
<meta>
<instanceID>one</instanceID>
<orx:instanceName>one</orx:instanceName>
<entity dataset="people" id="12345678-1234-4123-8234-123456789ccc" baseVersion="1" update="1">
<label>Bob (45)</label>
</entity>
</meta>
<name>Bob</name>
<age>45</age>
</data>`,
},
groupRepeat: {
one: `<data xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" id="groupRepeat">
<text>xyz</text>
Expand Down Expand Up @@ -681,7 +749,7 @@ module.exports = {
</hiv_medication>
</hospital>
<meta>
<instanceID>uuid:f7908274-ef70-4169-90a0-e1389ab732ff</instanceID>
<instanceID>uuid:f7908274-ef70-4169-90a0-e1389ab732ff</instanceID>
</meta>
</data>`
}
Expand Down

0 comments on commit 89c6b6c

Please sign in to comment.