CB-11776 Add test case for different edit-config targets
authorktop <ktop500@gmail.com>
Mon, 19 Sep 2016 17:53:51 +0000 (13:53 -0400)
committerSteve Gill <stevengill97@gmail.com>
Fri, 7 Oct 2016 03:23:28 +0000 (20:23 -0700)
 This closes #491

spec/ConfigChanges/ConfigChanges.spec.js
spec/fixtures/plugins/org.test.editconfigtest_two/plugin.xml

index 1daaa4b..f1c7e6d 100644 (file)
@@ -298,9 +298,10 @@ describe('config-changes module', function() {
 
                     var munger = new configChanges.PlatformMunger('android', temp, platformJson, pluginInfoProvider);
                     munger.process(plugins_dir);
-                    expect(spy.calls.length).toEqual(2);
+                    expect(spy.calls.length).toEqual(3);
                     expect(spy.argsForCall[0][2]).toEqual('/manifest/application/activity[@android:name=\'org.test.DroidGap\']');
                     expect(spy.argsForCall[1][2]).toEqual('/manifest/application/activity[@android:name=\'org.test.DroidGap\']');
+                    expect(spy.argsForCall[2][2]).toEqual('/manifest/uses-sdk');
                 });
                 it('should call graftXMLOverwrite for every new config munge with mode \'overwrite\' it introduces', function() {
                     shell.cp('-rf', editconfigplugin, plugins_dir);
index 5a64034..9c9e24b 100644 (file)
@@ -33,5 +33,8 @@
         <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:name='ChildApp']" mode="overwrite">
             <activity android:name="ChildApp" android:label="@string/app_name" android:enabled="false" />
         </edit-config>
+        <edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
+            <activity android:maxSdkVersion="23" />
+        </edit-config>
     </platform>
 </plugin>