Skip to content

Commit

Permalink
changed: updated appereances rules new columns, columns-pack, no-butt…
Browse files Browse the repository at this point in the history
…ons etc
  • Loading branch information
MartijnR committed Aug 2, 2019
1 parent b96b8a6 commit efb6be1
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 19 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

[Unreleased]
[1.7.0]
---------------------
##### Added
- Check for missing label elements.

##### Changed
- Updated appearances rules with new columns, columns-pack, no-buttons etc.

[1.6.1] - 2019-07-24
---------------------
##### Changed
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enketo-validate",
"version": "1.6.1",
"version": "1.7.0",
"description": "An XForm validator around Enketo's form engine",
"main": "src/validator.js",
"bin": "./validate",
Expand Down
79 changes: 65 additions & 14 deletions src/appearances.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,80 @@
"controls": [ "select1", "select" ]
},
"horizontal": {
"controls": [ "select", "select1", "range", "input" ]
"controls": [ "range", "input" ]
},
"vertical": "horizontal",
"no-buttons": {
"controls": [ "select", "select1" ],
"appearances": [ "columns", "columns-pack", "columns-1", "columns-2", "columns-3", "columns-4", "columns-5", "columns-6", "columns-7", "columns-8", "columns-9", "columns-10" ]
},
"compact": {
"controls": [ "select", "select1", "group" ]
"controls": [ "select", "select1" ],
"preferred": "columns-pack no-buttons"
},
"columns": {
"controls": [ "select", "select1" ]
},
"columns-pack": {
"controls": [ "select", "select1" ]
},
"no-collapse": {
"controls": [ "group" ]
},
"horizontal-compact": {
"controls": [ "select", "select1" ],
"preferred": "compact"
},
"compact-1": "compact",
"compact-2": "compact",
"compact-3": "compact",
"compact-4": "compact",
"compact-5": "compact",
"compact-6": "compact",
"compact-7": "compact",
"compact-8": "compact",
"compact-9": "compact",
"compact-10": "compact",
"preferred": "columns-pack"
},
"compact-1": {
"controls": [ "select", "select1" ],
"preferred": "columns-1 no-buttons"
},
"compact-2": {
"controls": [ "select", "select1" ],
"preferred": "columns-2 no-buttons"
},
"compact-3": {
"controls": [ "select", "select1" ],
"preferred": "columns-3 no-buttons"
},
"compact-4": {
"controls": [ "select", "select1" ],
"preferred": "columns-4 no-buttons"
},
"compact-5": {
"controls": [ "select", "select1" ],
"preferred": "columns-5 no-buttons"
},
"compact-6": {
"controls": [ "select", "select1" ],
"preferred": "columns-6 no-buttons"
},
"compact-7": {
"controls": [ "select", "select1" ],
"preferred": "columns-7 no-buttons"
},
"compact-8": {
"controls": [ "select", "select1" ],
"preferred": "columns-8 no-buttons"
},
"compact-9": {
"controls": [ "select", "select1" ],
"preferred": "columns-9 no-buttons"
},
"compact-10": {
"controls": [ "select", "select1" ],
"preferred": "columns-10 no-buttons"
},
"columns-1": "columns",
"columns-2": "columns",
"columns-3": "columns",
"columns-4": "columns",
"columns-5": "columns",
"columns-6": "columns",
"columns-7": "columns",
"columns-8": "columns",
"columns-9": "columns",
"columns-10": "columns",
"quick": {
"controls": [ "select", "select1" ]
},
Expand Down
7 changes: 5 additions & 2 deletions test/spec/xform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ describe( 'XForm', () => {
expect( arrContains( result.warnings, /"compact" for question "e"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"compact-19" for question "f"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"numbers" for question "g"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"horizontal-compact" for question "k" .+ deprecated.+"compact"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"field-list" for question "two"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"no-ticks" for question "g"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"maps" for question "h"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"signature" for question "h"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"pulldown" for question "i"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"horizontal-compact" for question "k" .+ deprecated.+"columns-pack"/i ) ).to.equal( true );
expect( arrContains( result.warnings, /"field-list" for question "two"/i ) ).to.equal( true );
} );

it( 'outputs no errors', () => {
Expand Down

0 comments on commit efb6be1

Please sign in to comment.