1
var suite = new Y.Test.Suite("datatable-message");
3
suite.add(new Y.Test.Case({
4
name: "lifecycle and instantiation",
6
"Y.DataTable should be augmented": function () {
8
new Y.DataTable().hasImpl(Y.DataTable.Message));
11
"Y.DataTable.Base should not be augmented": function () {
13
new Y.DataTable.Base().hasImpl(Y.DataTable.Message));
16
"Y.DataTable constructor should not error": function () {
17
var table = new Y.DataTable({
22
Y.Assert.isInstanceOf(Y.DataTable, table);
23
Y.Assert.isTrue(table.hasImpl(Y.DataTable.Message));
26
"test showMessaegs values": function () {
32
table = new Y.DataTable(config);
34
Y.Assert.isTrue(table.get('showMessages'));
36
config.showMessages = false;
37
table = new Y.DataTable(config);
39
Y.Assert.isFalse(table.get('showMessages'));
41
config.showMessages = true;
42
table = new Y.DataTable(config);
44
Y.Assert.isTrue(table.get('showMessages'));
46
config.showMessages = 'bogus';
47
table = new Y.DataTable(config);
49
Y.Assert.isTrue(table.get('showMessages'));
51
config.showMessages = { create: true, update: true, 'delete': false };
52
table = new Y.DataTable(config);
54
Y.Assert.isTrue(table.get('showMessages'));
57
"test set('showMessages')": function () {
58
var table = new Y.DataTable({
63
Y.Assert.isTrue(table.get('showMessages'));
65
table.set('showMessages', false);
66
Y.Assert.isFalse(table.get('showMessages'));
68
table.set('showMessages', true);
69
Y.Assert.isTrue(table.get('showMessages'));
71
table.set('showMessages', 'empty');
72
Y.Assert.isTrue(table.get('showMessages'));
74
table.set('showMessages', { empty: true, loading: false });
75
Y.Assert.isTrue(table.get('showMessages'));
78
suite.add(new Y.Test.Case({
79
name: "datatable-message",
81
"test showMessage()": function () {
85
"test showMessage(string)": function () {
89
"test showMessage(intlString)": function () {
93
"test hideMessage()": function () {
96
"adding rows should hide the message": function () {
100
"removing all rows should show the emptyMessage": function () {
105
Y.Test.Runner.add(suite);