Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXCDT-377: E2E test cases for keyword presevation #753

Merged
merged 24 commits into from
Feb 23, 2023

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Feb 23, 2023

🔧 Changes

While many unit tests were added alongside the integration of the preserveKeywords function into the export process (#751), there is still a need for E2E test cases that simulate more real scenarios. This PR adds these test cases for fuller testing coverage of the keyword preservation feature.

The work done in this PR has highlighted two key pieces of functionality missing:

  • Preserving keywords in auxillary files (ex: HTML templates, JS files)
  • Preservation of @@ array replacement syntax in YAML files due to invalid syntax if left as-is and invalid if wrapped in quotes.
    Both of the above have test cases written and commented-out but will be addressed in the coming days.

📚 References

Keyword Preservation RFC: #688
Related implementation PR: #751

🔬 Testing

This PR only adds testing.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@willvedd willvedd requested a review from a team as a code owner February 23, 2023 13:12
Comment on lines +399 to +404
// expect(yaml.tenant.enabled_locales).to.equal('@@LANGUAGES@@'); TODO: enable @@ARRAY@@ keyword preservation in yaml formats

// const emailTemplateHTML = fs
// .readFileSync(path.join(workDirectory, 'emailTemplates', 'welcome_email.html'))
// .toString();
// expect(emailTemplateHTML).to.contain('##TENANT##'); TODO: enable keyword preservation in auxillary template files
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the similar test below will be added in the coming days when the relevant fix has been added.

tenant:
allowed_logout_urls:
- https://travel0.com/logoutCallback
# enabled_locales: @@LANGUAGES@@ TODO: enable @@ARRAY@@ keyword preservation in yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also requires a fix that will come later.

@codecov-commenter
Copy link

Codecov Report

Base: 84.30% // Head: 84.30% // No change to project coverage 👍

Coverage data is based on head (32a7da8) compared to base (f5c7596).
Patch has no changes to coverable lines.

Additional details and impacted files
@@                             Coverage Diff                              @@
##           fix-make-keyword-preservation-more-flexible     #753   +/-   ##
============================================================================
  Coverage                                        84.30%   84.30%           
============================================================================
  Files                                              115      115           
  Lines                                             3486     3486           
  Branches                                           660      660           
============================================================================
  Hits                                              2939     2939           
  Misses                                             311      311           
  Partials                                           236      236           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Base automatically changed from fix-make-keyword-preservation-more-flexible to master February 23, 2023 19:18
@willvedd willvedd merged commit 36087d1 into master Feb 23, 2023
@willvedd willvedd deleted the DXCDT-377-keyword-preservation-e2e branch February 23, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants