New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

enketo-transformer

Package Overview
Dependencies
Maintainers
1
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enketo-transformer - npm Package Compare versions

Comparing version 1.41.2 to 1.41.3

test/forms/repeat.set.value.test3.xml

5

CHANGELOG.md

@@ -5,2 +5,7 @@ ## Change Log

[1.41.3] - 2020-12-21
------------------------
##### Fixed
- If the same repeat question has both a setvalue/odk-instance-first-load as well as a setvalue/xforms-value-changed, the output can get messed up.
[1.41.2] - 2020-11-18

@@ -7,0 +12,0 @@ ------------------------

6

package.json
{
"name": "enketo-transformer",
"version": "1.41.2",
"version": "1.41.3",
"description": "Library/app that transforms ODK-compliant XForms into a format that Enketo can consume",

@@ -49,4 +49,4 @@ "license": "Apache-2.0",

"docdash": "^1.2.0",
"eslint": "^7.13.0",
"eslint-plugin-jsdoc": "^30.7.8",
"eslint": "^7.16.0",
"eslint-plugin-jsdoc": "^30.7.9",
"http-server": "^0.12.3",

@@ -53,0 +53,0 @@ "istanbul-reporter-shield-badge": "^1.2.1",

@@ -168,3 +168,3 @@ /**

const name = setValueEl.attr( 'name' ).value();
const questionSameName = doc.get( `//*[@name="${name}" and contains(../@class, 'question')]` );
const questionSameName = doc.get( `//*[@name="${name}" and contains(../@class, 'question') and not(@type='hidden')]` );
if ( questionSameName ) {

@@ -171,0 +171,0 @@ //console.log( 'question with same name', setValueEl.parent().attr( 'class' ).value() );

@@ -17,3 +17,3 @@ const chai = require( 'chai' );

const elements = Array.prototype.slice.call( htmlDoc.getElementsByTagName( tagName ) );
const target = elements.find( el => el.getAttribute( 'name' ) === nameAttributeValue );
const target = elements.find( el => el.getAttribute( 'name' ) === nameAttributeValue );

@@ -780,2 +780,22 @@ return target || null;

} );
it( 'with a dynamic default repeat question, that also gets its value set by a trigger', () => {
const xform = fs.readFileSync( './test/forms/setvalue-repeat-tricky.xml', 'utf8' );
const transform = transformer.transform( { xform } ).then( parseHtmlForm );
return transform
.then( form => {
const ages = findElementsByName( form, 'input', '/data/person/group/age' );
expect( ages.length ).to.equal( 2 );
const agePrimary = ages[1]; // actual form control shown in form
const ageHidden = ages[0]; // hidden setvalue/xforms-value-changed directive
expect( agePrimary.getAttribute( 'data-event' ) ).to.equal( 'odk-new-repeat odk-instance-first-load' );
expect( agePrimary.getAttribute( 'data-setvalue' ) ).to.equal( '100' );
expect( ageHidden.getAttribute( 'data-event' ) ).to.equal( 'xforms-value-changed' );
expect( ageHidden.getAttribute( 'data-setvalue' ) ).to.equal( '15' );
} );
} );
} );

@@ -782,0 +802,0 @@ } );

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc