Comparison

spec/util_dataforms_spec.lua @ 9046:7cdc718312c8

util.dataforms: Include a fixed field in test
author Kim Alvefur <zash@zash.se>
date Sun, 15 Jul 2018 22:35:42 +0200
parent 8864:cf2f66b233d1
child 9083:5d3639e415bd
comparison
equal deleted inserted replaced
9045:4336a2b97aba 9046:7cdc718312c8
12 { 12 {
13 type = "hidden", 13 type = "hidden",
14 name = "FORM_TYPE", 14 name = "FORM_TYPE",
15 value = "xmpp:prosody.im/spec/util.dataforms#1", 15 value = "xmpp:prosody.im/spec/util.dataforms#1",
16 }; 16 };
17 {
18 type = "fixed";
19 value = "Fixed field";
20 },
17 { 21 {
18 type = "boolean", 22 type = "boolean",
19 label = "boolean-label", 23 label = "boolean-label",
20 name = "boolean-field", 24 name = "boolean-field",
21 value = true, 25 value = true,
308 assert.equal(nil, dataforms.get_type({})); 312 assert.equal(nil, dataforms.get_type({}));
309 assert.equal(nil, dataforms.get_type(st.stanza("no-a-form"))); 313 assert.equal(nil, dataforms.get_type(st.stanza("no-a-form")));
310 assert.equal("xmpp:prosody.im/spec/util.dataforms#1", dataforms.get_type(xform)); 314 assert.equal("xmpp:prosody.im/spec/util.dataforms#1", dataforms.get_type(xform));
311 end); 315 end);
312 end); 316 end);
317
318 describe(":data", function ()
319 it("works", function ()
320 assert.truthy(some_form:data(xform));
321 end);
322 end);
313 end); 323 end);
314 324