Add tests for Diff module

Created on 26 August 2014, over 10 years ago
Updated 16 December 2024, 5 days ago

This module does quite a lot, it turns out. It'd be great if there were tests to figure out if everything is working properly.

I'll try and document test cases as I find them here. Reviewing this module as part of #2325607: [meta] Get DMU working on Diff module .

Diff compare widgets

  • testRevisionsList — go to node/%node/revisions/list and verify diff output is on page.

Diff comparison

  • testRevisionsCompare — go to node/%node/revisions/view and verify diff comparison between 2 disparate revisions shows up.
  • testRevisionsLatest — go to node/%node/revisions/view/latest and verify that diff comparison against latest revision is shown

Diff admin settings


  • testDiffSettings — go to admin/config/content/diff and verify that main settings form is working properly.

  • testDiffSettingsNodeEntity — go to admin/config/content/diff/entities/node and verify settings form is working properly.
  • testDiffSettingsUserEntity — (not pictured) go to admin/config/content/diff/entities/user and verify settings form is working properly.


Inline differences block



  • testDiffBlock — Make sure block shows up in block listing at admin/structure/block, verify it shows up on content types selected.
  • testInlineDiff — (??? — not sure if this can be tested w/ SimpleTest). Test that changes are correctly highlighted when selecting revisions from block.

Diff buttons


  • testViewChanges — verify that "View changes" button shows up on node edit form, shows diff at top when clicked.

Node type form settings

  • testDiffSettingsNodeType — verify that Compare revisions options are working on e.g. Page.

Diff entity display

  • testDiffDisplayMode — Go to admin/structure/types/manage/page/display, expand "Custom display settings, verify "revision comparison" shows up as a selectable view mode.

If someone feels exceptionally spunky

  • testLimitedItems — verify that REVISION_LIST_SIZE is working properly.
  • testExposedSorting — verify that diff sorting is working properly: DIFF_SORT_NONE, DIFF_SORT_VALUE, DIFF_SORT_CUSTOM.
  • testHelpText — test that help text is exposed where it should be (admin/help/diff, node/%/revisions/%/view, node/%/revisions/view/%/%
  • testDiffStates — test diff states (raw (Standard) / raw_plain (Marked down)
  • testRevisionAdminTheme — tests that revisions pages are shown in admin theme
  • testContentTypeRename — tests that when you rename a content type, all settings are remembered.
  • testContentTypeDelete — tests that when you delete a content type, all settings are deleted.
  • testDiffUsers — tests that diff features also work on users.
📌 Task
Status

Closed: outdated

Version

3.0

Component

Code

Created by

🇨🇦Canada webchick Vancouver 🇨🇦

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024