it('should call pruneXMLRemove for every new config.xml config munge with mode \'remove\' it introduces', function () { const platformJson = PlatformJson.load(plugins_dir, 'android'); // var spy = spyOn(xml_helpers, 'pruneXMLRemove').andReturn(true); const munger = new configChanges.PlatformMunger('android', temp, platformJson); munger.add_config_changes(cfg, true).save_all(); const am_xml = new et.ElementTree(et.XML(fs.readFileSync(path.join(temp, 'AndroidManifest.xml'), 'utf-8'))); const sdk = am_xml.find('./uses-sdk'); expect(sdk).toBeDefined(); expect(sdk.attrib['android:maxSdkVersion']).toBeUndefined(); });
it('should overwrite config.xml config munge for every new config.xml config munge that has the same target', function () { const editconfig_cfg = new ConfigParser(editconfig_xml); const platformJson = PlatformJson.load(plugins_dir, 'android'); const munger = new configChanges.PlatformMunger('android', temp, platformJson, pluginInfoProvider); munger.add_config_changes(cfg, true).save_all(); munger.add_config_changes(editconfig_cfg, true).save_all(); const am_xml = new et.ElementTree(et.XML(fs.readFileSync(path.join(temp, 'AndroidManifest.xml'), 'utf-8'))); const sdk = am_xml.find('./uses-sdk'); expect(sdk).toBeDefined(); expect(sdk.attrib['android:targetSdkVersion']).toEqual('23'); expect(sdk.attrib['android:minSdkVersion']).toEqual('5'); expect(sdk.attrib['android:maxSdkVersion']).toBeUndefined(); });