aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_dataforms_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-16 12:55:55 +0200
committerKim Alvefur <zash@zash.se>2020-08-16 12:55:55 +0200
commit1c0e4300ab36e37cb2ba83e5dca9f9247785bed6 (patch)
tree7bef008214ad5430778375bab6e6b3b3095b6d5b /spec/util_dataforms_spec.lua
parent9287d929c220bd88fff5458f143f24512800a63e (diff)
downloadprosody-1c0e4300ab36e37cb2ba83e5dca9f9247785bed6.tar.gz
prosody-1c0e4300ab36e37cb2ba83e5dca9f9247785bed6.zip
util.dataforms: Convert media element sizes to avoid error on Lua 5.3
The stanza API does not accept number values and threw an error due to the height and width attributes of the media element (XEP-0221). This part had no test coverage previously, explaining why it was not discovered until now.
Diffstat (limited to 'spec/util_dataforms_spec.lua')
-rw-r--r--spec/util_dataforms_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/util_dataforms_spec.lua b/spec/util_dataforms_spec.lua
index 085128d1..ae6098be 100644
--- a/spec/util_dataforms_spec.lua
+++ b/spec/util_dataforms_spec.lua
@@ -106,6 +106,21 @@ describe("util.dataforms", function ()
name = "text-single-field",
value = "text-single-value",
},
+ {
+ -- XEP-0221
+ -- TODO Validate the XML produced by this.
+ type = "text-single",
+ label = "text-single-with-media-label",
+ name = "text-single-with-media-field",
+ media = {
+ height = 24,
+ width = 32,
+ {
+ type = "image/png",
+ uri = "data:",
+ },
+ },
+ },
});
xform = some_form:form();
end);