From 8f7606ffc90e27f94c548a5db3207c8fe52b7640 Mon Sep 17 00:00:00 2001 From: Rachel White Date: Mon, 13 Jun 2016 15:23:08 -0400 Subject: [PATCH] separated new plugin tests into new format --- .../input-plugins/input-plugin-checkbox.js | 37 +++++++++++++++++++ .../input-plugin-multiple-select.js | 27 ++++++++++++++ .../input-plugins/input-plugin-range.js | 25 +++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 tests/fixtures/input-plugins/input-plugin-checkbox.js create mode 100644 tests/fixtures/input-plugins/input-plugin-multiple-select.js create mode 100644 tests/fixtures/input-plugins/input-plugin-range.js diff --git a/tests/fixtures/input-plugins/input-plugin-checkbox.js b/tests/fixtures/input-plugins/input-plugin-checkbox.js new file mode 100644 index 0000000..94e464e --- /dev/null +++ b/tests/fixtures/input-plugins/input-plugin-checkbox.js @@ -0,0 +1,37 @@ +const validation = require('./lib/validation.js'); + +module.exports = { + name: 'Checkbox Selector', + description: 'Select items', + validation: { + checkboxValidation: validation, + }, + inputs: { + checkboxSelector: { + validation: { + function: 'checkboxValidation', + on: 'blur', + }, + label: 'Select items', + type: 'checkbox', + options: [ + { label: 'red', + value: 'red', + }, + { label: 'blue', + value: 'blue', + }, + { label: 'green', + value: 'green', + }, + { label: 'yellow', + value: 'yellow', + }, + ], + settings: { + empty: false + }, + }, + }, + html: `{% for option in checkboxSelector.options %}{% endfor %}`, +}; \ No newline at end of file diff --git a/tests/fixtures/input-plugins/input-plugin-multiple-select.js b/tests/fixtures/input-plugins/input-plugin-multiple-select.js new file mode 100644 index 0000000..505c99e --- /dev/null +++ b/tests/fixtures/input-plugins/input-plugin-multiple-select.js @@ -0,0 +1,27 @@ +const validation = require('./lib/validation.js'); + +module.exports = { + name: 'Multiple Kitten Name Selector', + description: 'Select a few kitten names', + validation: { + kittenNameMultipleSelectorValidation: validation, + }, + inputs: { + kittenNameSelector: { + validation: { + function: 'kittenNameMultipleSelectorValidation', + on: 'blur', + }, + label: 'Select a few kitten names', + type: 'select', + settings: { + empty: false, + multiple: true, + names: ['Michaelangelo', 'Leonardo', 'Raphael', 'Donatello', 'Muffins', 'Jeff'] + }, + }, + }, + html: ``, +}; \ No newline at end of file diff --git a/tests/fixtures/input-plugins/input-plugin-range.js b/tests/fixtures/input-plugins/input-plugin-range.js new file mode 100644 index 0000000..50b2e01 --- /dev/null +++ b/tests/fixtures/input-plugins/input-plugin-range.js @@ -0,0 +1,25 @@ +const validation = require('./lib/validation.js'); + +module.exports = { + name: 'Range Selector', + description: 'Select a range', + validation: { + rangeValidation: validation, + }, + inputs: { + rangeSelector: { + validation: { + function: 'rangeValidation', + on: 'blur', + }, + label: 'Select a range', + type: 'range', + settings: { + empty: true, + min: 1, + max: 5 + }, + }, + }, + html: ``, +}; \ No newline at end of file