Comparison

spec/util_dataforms_spec.lua @ 11026:a086825ed73a

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.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Aug 2020 12:55:55 +0200
parent 10512:3089086d31fa
child 11027:8ed6c5bdbb21
comparison
equal deleted inserted replaced
11025:e47e7185b403 11026:a086825ed73a
103 { 103 {
104 type = "text-single", 104 type = "text-single",
105 label = "text-single-label", 105 label = "text-single-label",
106 name = "text-single-field", 106 name = "text-single-field",
107 value = "text-single-value", 107 value = "text-single-value",
108 },
109 {
110 -- XEP-0221
111 -- TODO Validate the XML produced by this.
112 type = "text-single",
113 label = "text-single-with-media-label",
114 name = "text-single-with-media-field",
115 media = {
116 height = 24,
117 width = 32,
118 {
119 type = "image/png",
120 uri = "data:",
121 },
122 },
108 }, 123 },
109 }); 124 });
110 xform = some_form:form(); 125 xform = some_form:form();
111 end); 126 end);
112 127