Add substitutions to GLFM static HTML snapshot examples
What does this MR do and why?
Relates: Tracking Issue: Implement GLFM scripts per the ... (#361241)
Add support for normalizing entries in GitLab Flavored Markdown static HTML snapshot entries, to replace variable values in actual HTML API responses.
This is done by replacing variable values via regexes specified in spec/fixtures/glfm/example_snapshots/html.yml
.
This is a port and improvement of the "substitutions" logic from Golden Master specs in spec/fixtures/markdown/markdown_golden_master_examples.yml
.
Tasks
-
Update doc/development/gitlab_flavored_markdown/specification_guide/index.md
for new substitutions file.
How to set up and validate locally
- Review the new normalization documentation which was added in this MR in
doc/development/gitlab_flavored_markdown/specification_guide/index.md
to understand how it works. - Run
spec/requests/api/markdown_snapshot_spec.rb
withFOCUSED_MARKDOWN_EXAMPLES=07_01__gitlab_specific_markdown__footnotes__001
- The spec should pass
- Comment the line
07_01_href: *07_01_href
inglfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml
- Run again and see it fail because the
href
value was not normalized. - Uncomment the line
07_01_href: *07_01_href
and instead comment the line07_01_id: *07_01_id
- Run again and see it fail because
id
value was not normalized.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Chad Woolley