diff --git a/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml b/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml index b299b645..5cd28720 100644 --- a/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml +++ b/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml @@ -76,6 +76,7 @@ target-dir="app/libs" /> + diff --git a/spec/fixtures/org.test.plugins.dummyplugin/src/android/mysettings.xml b/spec/fixtures/org.test.plugins.dummyplugin/src/android/mysettings.xml new file mode 100644 index 00000000..421376db --- /dev/null +++ b/spec/fixtures/org.test.plugins.dummyplugin/src/android/mysettings.xml @@ -0,0 +1 @@ +dummy diff --git a/spec/unit/pluginHandlers/handlers.spec.js b/spec/unit/pluginHandlers/handlers.spec.js index 60a69144..6d90bd02 100644 --- a/spec/unit/pluginHandlers/handlers.spec.js +++ b/spec/unit/pluginHandlers/handlers.spec.js @@ -127,6 +127,13 @@ describe('android project handler', function () { expect(copyFileSpy) .toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false); }); + + it('Test#006d : should allow installing xml file from sources with old target-dir scheme', function () { + android['source-file'].install(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true}); + expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, + 'src/android/mysettings.xml', temp, + path.join('app/src/main/res/xml/mysettings.xml'), false); + }); }); describe('of elements', function () { @@ -300,6 +307,12 @@ describe('android project handler', function () { android['source-file'].uninstall(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true}); expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestAar.aar')); }); + + it('Test#019d : should remove stuff by calling common.removeFile for Android Studio projects, of xml with old target-dir scheme', function () { + android['source-file'].install(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true}); + android['source-file'].uninstall(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true}); + expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/xml/mysettings.xml')); + }); }); describe('of elements', function () {