Diff

spec/util_datamapper_spec.lua @ 11438:b7807583de34

util.datamapper: Add logic for "boolean" tags here the presence means true
author Kim Alvefur <zash@zash.se>
date Sun, 07 Mar 2021 01:41:39 +0100
parent 11437:87a684df4b65
child 11439:9abcdfdcdb01
line wrap: on
line diff
--- a/spec/util_datamapper_spec.lua	Sat Mar 06 23:14:23 2021 +0100
+++ b/spec/util_datamapper_spec.lua	Sun Mar 07 01:41:39 2021 +0100
@@ -31,6 +31,10 @@
 					type = "string";
 					xml = {x_name_is_value = true; namespace = "http://jabber.org/protocol/chatstates"};
 				};
+				fallback = {
+					type = "boolean";
+					xml = {x_name_is_value = true; name = "fallback"; namespace = "urn:xmpp:fallback:0"};
+				};
 			};
 		};
 
@@ -39,6 +43,7 @@
 				<body>Hello</body>
 				<delay xmlns='urn:xmpp:delay' from='test' stamp='2021-03-07T15:59:08+00:00'>Becasue</delay>
 				<active xmlns='http://jabber.org/protocol/chatstates'/>
+				<fallback xmlns='urn:xmpp:fallback:0'/>
 				</message>
 				]];
 
@@ -51,6 +56,7 @@
 			body = "Hello";
 			delay = {from = "test"; stamp = "2021-03-07T15:59:08+00:00"; reason = "Becasue"};
 			state = "active";
+			fallback = true;
 		};
 	end);