diff --git a/README.md b/README.md index 3bc81dd0..0e6c32f4 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,14 @@ This ignore mechanism works with any of the changes that the codemods in this package will try to suggest. +## Environment Support + +The codemod tool supports multiple deployment environments. Test fixtures include examples for: +- `sandbox.wdesk.com` - Sandbox environment +- `ca.wdesk.com` - CA production environment (prod-ca) + +When generating HTML or Dart code with preconnect links, ensure URLs follow the appropriate environment pattern. + ## Authoring codemods ### Resources diff --git a/test/rmui_bundle_updater_suggestors/dart_script_updater_test.dart b/test/rmui_bundle_updater_suggestors/dart_script_updater_test.dart index 833df717..4dcf4543 100644 --- a/test/rmui_bundle_updater_suggestors/dart_script_updater_test.dart +++ b/test/rmui_bundle_updater_suggestors/dart_script_updater_test.dart @@ -420,5 +420,90 @@ void main() { ); }); }); + + test('in context with ca environment HTML logic', () async { + await testSuggestor( + expectedPatchCount: 4, + shouldDartfmtOutput: false, + input: ''' + List _reactHtmlHeaders = const [ + '', + '', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' Wdesk', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '', + ];''', + expectedOutput: ''' + List _reactHtmlHeaders = const [ + '', + '', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' Wdesk', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '', + ];\n''', + ); + }); }); } diff --git a/test/rmui_bundle_updater_suggestors/html_script_updater_test.dart b/test/rmui_bundle_updater_suggestors/html_script_updater_test.dart index a8378323..e66571f5 100644 --- a/test/rmui_bundle_updater_suggestors/html_script_updater_test.dart +++ b/test/rmui_bundle_updater_suggestors/html_script_updater_test.dart @@ -289,5 +289,90 @@ void main() { '', ); }); + + test('in context with ca environment HTML logic', () async { + await testSuggestor( + expectedPatchCount: 4, + shouldDartfmtOutput: false, + input: '' + '\n' + '\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' Wdesk\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + '\n' + '', + expectedOutput: '' + '\n' + '\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' Wdesk\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + '\n' + '', + ); + }); }); }