Github user daserge commented on a diff in the pull request: https://github.com/apache/cordova-windows/pull/207#discussion_r87598394 --- Diff: spec/unit/ConfigChanges.spec.js --- @@ -161,3 +165,40 @@ describe('Capabilities within package.windows.appxmanifest', function() { }); }); +describe('generate_plugin_config_munge for windows project', function() { + beforeEach(function() { + shell.mkdir('-p', tempDir); + shell.cp('-rf', windows_testapp_jsproj, tempDir); + }); + + afterEach(function() { + shell.rm('-rf', tempDir); + }); + + it('should special case config-file elements for windows', function() { + var pluginInfoProvider = new PluginInfoProvider(); + var munger = new configChanges.PlatformMunger('windows', tempDir, 'unused', null, pluginInfoProvider); + + var munge = munger.generate_plugin_config_munge(pluginInfoProvider.get(configplugin), {}); + var windows81AppxManifest = munge.files['package.windows.appxmanifest']; + var winphone81AppxManifest = munge.files['package.phone.appxmanifest']; + var windows10AppxManifest = munge.files['package.windows10.appxmanifest']; + + // 1 comes from versions="=8.1.0" + 1 from versions="=8.1.0" device-target="windows" + expect(windows81AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />'); + expect(windows81AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win81-win-and-phone" />'); + expect(windows81AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-for-win81-win-only" />'); + expect(windows81AppxManifest.parents['/Parent/Capabilities'][3].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />'); --- End diff -- Please add checks for capabilities count back - they could prevent situation when we have something extraneous. `expect(windows81AppxManifest.parents['/Parent/Capabilities'][0].count).toBe(3);`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org