Kim Alvefur
43351d2b54
Spelling: Fix various spelling mistakes (thanks timeless)
...
Words, sometimes I wonder how they even work
Maybe I missed something.
4 years ago
Kim Alvefur
1a0be02fe8
util.dataforms: Ensure larger integers are serialized as such
...
Assumes that most number fields are integers, as most numeric types
listed in XEP-0122 are, as are all such fields in Prosody as of this.
Otherwise %g produces something like 1.1259e+15
4 years ago
Kim Alvefur
9a080dc12e
util.dataforms: Scope integer handling tests
...
So they're separate from the datetime tests, and any future validation
tests
4 years ago
Kim Alvefur
f956b07ca0
util.dataforms: Turn number values into timestamps for datetime fields
...
Makes it symmetric with parsing.
4 years ago
Kim Alvefur
fc677f515f
util.dataforms: Coerce number values for boolean fields
...
Makes more sense than coercing to a string, which would always be
truthy.
4 years ago
Kim Alvefur
851127ecd7
util.dataforms: Add support for datetime field types via XEP-0122
4 years ago
Kim Alvefur
bc20052a9b
util.dataforms: Add support for validating (integer) ranges
6 years ago
Kim Alvefur
8de93db692
util.dataforms: Add more XEP-0211 media element test coverage
5 years ago
Kim Alvefur
1c0e4300ab
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.
5 years ago
Kim Alvefur
6b533ad772
util.dataforms: Improve descriptions in tests
6 years ago
Kim Alvefur
9c1528bf2e
util.dataforms: Add support for XEP-0122: Data Forms Validation
...
Initially only basic validation of xs:integer
7 years ago
Kim Alvefur
3da47d7dde
util.dataforms: Allow field names to be different from the 'var' attribute
...
This should allow the usage of long prefixes and namespace-like names to
be contained to the XML representation of the form, so that the code can
use more convenient names.
7 years ago
Kim Alvefur
876b96659c
util.dataforms: Allow passing the current values to be used in stead of omitted fields
8 years ago
Kim Alvefur
00a2891787
util.dataforms: Add failing test for #1177
8 years ago
Kim Alvefur
0913989a69
util.dataforms: Include a fixed field in test
8 years ago
Kim Alvefur
a7448e43e0
util.dataforms: Add a simple function for identifying form types
...
This is meant to allow identifying forms without parsing them
completely.
8 years ago
Kim Alvefur
2a7da89567
util.dataforms: Add initial tests
...
This covers basic form generation, that the fields have the correct
attributes, children and text content.
8 years ago