aft-web-services
Version:
Automated Functional Testing (AFT) module for testing web services over HTTP and HTTPS
20 lines • 982 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const src_1 = require("../../src");
describe('XML', () => {
it('can parse XML string to JSON object', () => {
let xmlStr = '<xml><image src="./foo/bar">fake photo</image><hr /><span style="colour:#ff6060" class="hidden rounded">Do Work</span></xml>';
let jsonObj = src_1.XML.fromString(xmlStr);
expect(jsonObj).toBeDefined();
expect(jsonObj.xml).toBeDefined();
expect(jsonObj.xml.image).toBeDefined();
expect(jsonObj.xml.image["@src"]).toBe('./foo/bar');
expect(jsonObj.xml.image.keyValue).toBe('fake photo');
expect(jsonObj.xml.hr).toBeDefined();
expect(jsonObj.xml.span).toBeDefined();
expect(jsonObj.xml.span["@style"]).toBe('colour:#ff6060');
expect(jsonObj.xml.span["@class"]).toBe('hidden rounded');
expect(jsonObj.xml.span.keyValue).toBe('Do Work');
});
});
//# sourceMappingURL=xml-spec.js.map