datatable-core-tests.js revision 75ae44e882c66d6b0f2e1066d30ead63e58c2056
name: "Class extension",
testClassExtension: function () {
i;
}
}
}
}));
name: "delegate",
setUp: function () {
},
"test table.delegate() pases through to node.delegate()": function () {
pass;
Y.delegate = function () {
pass = true;
};
}
}));
name: "getCell",
setUp: function () {
},
"test getCell() passes through to bodyView": function () {
var pass = {},
getCell: function () {
return pass;
}
})
}).render(),
}
}));
name: "getRow",
setUp: function () {
},
"test getRow() passes through to bodyView": function () {
var pass = {},
getRow: function () {
return pass;
}
})
}).render(),
}
}));
name: "getRecord",
setUp: function () {
ATTRS: {
bodyView: {
getRecord: function () {
return pass;
}
})
}
}
});
columns: ['a'],
data: [
]
});
},
tearDown: function () {
},
"test getRecord(index)": function () {
},
"test getRecord(id)": function () {
},
"test getRecord(clientId)": function () {
},
"test getRecord(unknown) passes through to bodyView": function () {
}
}));
name: "getColumn",
setUp: function () {
this.columns = [
'a',
];
data: []
});
},
"test getColumn(key)": function () {
},
"test getColumn(name)": function () {
},
"test getColumn(index)": function () {
},
"test getColumn([ index, index ])": function () {
},
"test getColumn(column)": function () {
}
}));
name: "render",
setUp: function () {
data: [
{ a: 1, b: 1, c: 1 },
{ a: 2, b: 2, c: 2 },
{ a: 3, b: 3, c: 3 }
]
});
},
tearDown: function () {
},
"render() should create a <table>": function () {
},
"render() should fire the renderTable event": function () {
var pass;
},
"render() should assign the instance's _tableNode property": function () {
},
"render() should create a <caption> if configured to do so": function () {
},
"render() should create a <table summary='VALUE'> if configured to do so": function () {
},
"render() should fire renderHeader if headerView is set": function () {
var pass;
pass = true;
});
},
"render() should fire renderBody if bodyView is set": function () {
var pass;
pass = true;
});
},
"render() should fire renderFooter if footerView is set": function () {
var pass;
pass = true;
});
},
"render() should call render() on the headerView if set": function () {
var pass;
render: function () {
pass = true;
}
})).render();
},
"render() should call render() on the bodyView if set": function () {
var pass;
render: function () {
pass = true;
}
})).render();
},
"render() should call render() on the footerView if set": function () {
var pass;
render: function () {
pass = true;
}
})).render();
}
}));
name: "syncUI",
setUp: function () {
ATTRS: {
headerView: {
})
},
bodyView: {
})
},
footerView: {
})
}
}
});
columns: ['a'],
data: [{ a: 1 }]
}).render();
},
tearDown: function () {
},
"syncUI should call render() on all views": function () {
}
}));
name: "caption attribute",
setUp: function () {
this.withCaption = new Table({
caption: 'caption content',
columns: ['a'],
data: []
});
columns: ['a'],
data: []
});
},
tearDown: function () {
this.withCaption.destroy();
},
"set('caption', VALUE) should update UI": function () {
},
"set('caption', VALUE) after unset at render() should add <caption>": function () {
},
"set('caption', FALSEY_VALUE) after set at render() should remove <caption>": function () {
},
"set('caption', FALSEY_VALUE) after unset at render() should do nothing": function () {
}
}));
name: "columns attribute",
setUp: function () {
},
"string columns should be converted to objects": function () {
data: []
}),
},
"test columnset pass through": function () {
data: []
}),
},
"duplicate keys should have unique column ids": function () {
columns: [
'a',
{ key: 'a' },
],
data: []
}),
},
"child columns should get _parent property pointing to their parent": function () {
columns: [
'a',
{
name: 'bcdX',
children: [
'b',
]
}
],
data: []
}),
},
"set('columns', VALUE) should update getColumn(NAME) map": function () {
data: []
}),
},
"get('columns.KEY') should return column object based on _id": function () {
columns: [
'a',
{
name: 'bcdX',
children: [
]
}
],
data: []
});
},
"test col.field alias for col.name": function () {
columns: [
],
data: []
});
}
}));
name: "data attribute",
setUp: function () {
this.data = [
{ a: 1, b: true, c: 'string #1' },
{ a: 2, b: false, c: 'string #2' }
];
ATTRS: {
a: {},
b: {},
c: {}
}
});
},
"test array as data value": function () {
});
},
"test ModelList passed as data value": function () {
});
},
"set('data', array) should update the existing ModelList": function () {
data: []
}),
},
"set('data', modelList) should replace the existing ModelList": function () {
data: []
}),
},
"set('data', garbage) should do nothing": function () {
}),
},
"set('data', modelList) after render() should update view modelList attrs": function () {
}, {
ATTRS: {
modelList: {
}
}
}),
}).render();
// 0 to 2 because lazy assignment calls the setter the first time
// the modelList is fetched, which happens to be as part of the
// set() logic. So the setter is called for the original value to
// populate the change event's e.prevVal.
},
"set('data', modelList) should fire a dataChange": function () {
ATTRS: { a: {}, b: {}, c: {} } }),
}),
fired = true;
});
},
"test recordset pass through": function () {
}),
records: [
{ a: 4, b: 4, c: 4 }
]
});
}
}));
name: "recordType attribute",
setUp: function () {
},
"test instantiation with recordType: object": function () {
recordType: {
b: { value: 'b default' },
c: {}
},
data: [
{ a: 1, b: 'string', c: 1 },
{ a: '2', c: 2 }
]
});
},
"test instantiation with recordType: array": function () {
data: [
{ a: 1, b: 1, c: 1 },
{ a: 2, b: 2, c: 2 }
]
});
},
"test instantiation with recordType: Model": function () {
ATTRS: {
b: { value: 'b default' },
c: {}
}
}),
data: [
{ a: 1, b: 'string', c: 1 },
{ a: '2', c: 2 }
]
});
},
"recordType should default from data modelList.model": function () {
ATTRS: {
b: { value: 'b default' },
c: {}
}
});
{ a: 1, b: 'string', c: 1 },
{ a: '2', c: 2 }
]);
});
},
"recordType should default from keys of first object in data array": function () {
data: [
{ a: 1, b: 1, c: 1 },
{ a: 2, b: 2, c: 2 }
]
});
},
"recordType should default from columns if no data is supplied": function () {
});
// including dup columns by their _id
},
"recordType should default via change event if recordType, columns, and data are unset": function () {
ATTRS: { a: {}, b: {}, c: {} }
});
}
}));
name: "summary attribute",
setUp: function () {
this.withSummary = new Table({
summary: 'summary content',
columns: ['a'],
data: []
});
columns: ['a'],
data: []
});
},
tearDown: function () {
this.withCaption.destroy();
},
"set('summary', VALUE) should update UI": function () {
},
"set('summary', VALUE) after unset at render() should add table summary": function () {
},
"set('summary', '') after set at render() should empty table summary": function () {
},
"set('summary', '') after unset at render() should do nothing": function () {
}
}));