diff --git a/packages/xmlbuilder/xmlbuilder_tests.js b/packages/xmlbuilder/xmlbuilder_tests.js
index a3b894fbab..74c8532945 100644
--- a/packages/xmlbuilder/xmlbuilder_tests.js
+++ b/packages/xmlbuilder/xmlbuilder_tests.js
@@ -1,40 +1,39 @@
-const expectedResult = `XmlBuilderTestThis is a Meteor test caseMeteor Developer`;
-
-const accessRules = {
- 'tel:*': { type: 'intent' },
- 'geo:*': { type: 'intent' },
- 'mailto:*': { type: 'intent' },
- 'sms:*': { type: 'intent' },
- 'market:*': { type: 'intent' },
- 'itms:*': { type: 'intent' },
- 'itms-apps:*': { type: 'intent' },
- 'http://localhost': { type: 'navigation' }
-};
-
-const metadata = {
- id: 'com.meteor.xmlbuilder_test',
- version: '0.0.1',
- author: 'Meteor Developer',
- contentUrl: `http://localhost:3000/`
-};
-
-const additionalConfiguration = {
- global: {
- 'webviewbounce': false,
- 'DisallowOverscroll': true
- },
- platform: {
- ios: {},
- android: {}
- }
-};
-
-const custom = [``];
-
// this test case mimics about 80 precent of the code used to build the
// config.xml file from the following file (meteor/tools/cordova/builder.js)
// and it exercies all the funcitons used from the xmlbuilder2 api
Tinytest.add("xmlbuilder - config.xml file generation", function (test) {
+ const expectedResult = `XmlBuilderTestThis is a Meteor test caseMeteor Developer`;
+
+ const accessRules = {
+ 'tel:*': { type: 'intent' },
+ 'geo:*': { type: 'intent' },
+ 'mailto:*': { type: 'intent' },
+ 'sms:*': { type: 'intent' },
+ 'market:*': { type: 'intent' },
+ 'itms:*': { type: 'intent' },
+ 'itms-apps:*': { type: 'intent' },
+ 'http://localhost': { type: 'navigation' }
+ };
+
+ const metadata = {
+ id: 'com.meteor.xmlbuilder_test',
+ version: '0.0.1',
+ author: 'Meteor Developer',
+ contentUrl: `http://localhost:3000/`
+ };
+
+ const additionalConfiguration = {
+ global: {
+ 'webviewbounce': false,
+ 'DisallowOverscroll': true
+ },
+ platform: {
+ ios: {},
+ android: {}
+ }
+ };
+
+ const custom = [``];
let config = XmlBuilder.create({ version: '1.0' }).ele('widget');
// Set the root attributes
@@ -107,5 +106,36 @@ Tinytest.add("xmlbuilder - config.xml file generation", function (test) {
test.equal(formattedXmlConfig, expectedResult);
});
+Tinytest.add("xmlbuilder - create() funciton", function (test) {
+ const expectedResult = '';
+
+ let widgetNode = XmlBuilder.create({ version: '1.0' }).ele('widget');
+ let formattedXmlConfig = widgetNode.end();
+ test.equal(formattedXmlConfig, expectedResult);
+
+ widgetNode = XmlBuilder.create().ele('widget');
+ formattedXmlConfig = widgetNode.end();
+ test.equal(formattedXmlConfig, expectedResult);
+
+});
+
+Tinytest.add("xmlbuilder - att() function", function (test) {
+ const expectedResult = '';
+
+ let config = XmlBuilder.create().ele('widget');
+ config.att({ key: 'test' });
+ let formattedXmlConfig = config.end();
+ test.equal(formattedXmlConfig, expectedResult);
+});
+
+Tinytest.add("xmlbuilder - ele() function", function (test) {
+ let expectedResult = 'XmlBuilderTest';
+ let config = XmlBuilder.create().ele('widget');
+ config.ele('name').txt('XmlBuilderTest');
+
+ const formattedXmlConfig = config.end();
+ test.equal(formattedXmlConfig, expectedResult);
+});
+