add radio component

This commit is contained in:
Keegan
2016-02-14 02:31:46 -08:00
parent f00b288a82
commit 71dd8ef1c3
12 changed files with 186 additions and 31 deletions
+19 -2
View File
@@ -7,7 +7,7 @@ var fixture = require('../../fixture');
describe('manipulators', function() {
/**
* @param {string} itemType
* @param {string|Clay~ConfigItem} itemType
* @param {*} value
* @param {*} [expected]
* @return {void}
@@ -31,7 +31,7 @@ describe('manipulators', function() {
}
/**
* @param {string} itemType
* @param {string|Clay~ConfigItem} itemType
* @return {void}
*/
function testDisable(itemType) {
@@ -85,6 +85,23 @@ describe('manipulators', function() {
testEnable('toggle');
});
describe('radio', function() {
var item = {
type: 'radio',
clayId: 1,
options: [
{ label: '1', value: 'one' },
{ label: '2', value: 'two' },
{ label: '3', value: 'three "quote' }
]
};
testSetGet(item, 'one');
testSetGet(item, 'two');
testSetGet(item, 'three "quote');
testDisable(item);
testEnable(item);
});
describe('color', function() {
testSetGet('color', 'FF0000', 0xff0000);
testSetGet('color', '#FF0000', 0xff0000);