Re-enable Rapid Diffs note permalink feature specs
What does this MR do and why?
This MR re-enables the two diff comment permalink examples in user_interacts_with_batched_mr_diffs_spec.rb, which were skipped during the Rapid Diffs feature spec migration.
They failed because they left-clicked the comment timestamp and then opened the page's current URL. On the Changes tab that click stays on the page and sets only #note_<id>. The file params are left out of the address bar on purpose, so reloading the page doesn't pin that file. The link's href does carry them (?file_path=<path>#note_<id>), and that's what copying the link or opening it in a new tab uses. The examples now open the href. The page-2 example checks that the comment is visible in the first file shown, since a link that names a file opens with that file first.
The page-2 example no longer checks that the first file's comment is hidden. Rapid Diffs renders the linked file first, so the first file sits right below it. That check depended on the legacy file order, and it only passed before because a helper scrolled to the bottom of the page.
References
How to set up and validate locally
- Make sure the
rapid_diffs_default_on_mr_showfeature flag is enabled. - Open a merge request with many changed files on the Changes tab and add a comment on a line in one of the last files.
- Copy the comment's timestamp link. It includes
file_path=<path>before#note_<id>. - Open the copied link in a new tab. It opens on that file and scrolls to the comment.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.