User:PerfektesChaos/js/fragmentAnchors/Test

Test cases for fragmentAnchors gadget.

Installation Check edit

  1. Follow the instructions at fragmentAnchors #Usage.
  2. Open any page, or reload this test page.
  3. Find a   link in tool box (usually in left column of portal) and click.

Test cases edit

Correct Anchors edit

Within this text a   should appear now.

  • Hover on the symbol: A bubble above tells you „insertion“.
  • Click on the symbol: A bubble below tells you [[#insertion]].
  • Click once again and the bubble vanishes.

Multiple Anchors edit

If the same identifier is provided multiple times, only the first one could be addressed and any other is unreachable.

  1. An identifier twice was given in this line …
  2. … and here again.

Both should be marked with a red symbol on yellow square now. On top of the page this is reported in a red box by 2× #twice item. The behaviour on mouse action is the same as with correct anchors.

  • An empty identifier is meaningless and regarded as duplication of the entire document address, reported above by 1× # item.

Missing Anchors edit

On page view (not editing) it will be checked whether there is a target for every internal link.

  • This link points correctly to top of the page.
  • This link points to nirvana which was not found; at least not within this page. It is decorated by # ahead and reported by −1× #nirvana item.

Uncertain target edit

In section „Multiple Anchorstwice has been declared twice. If this will be distinguished, it is still unclear which link should point to which location and which links should be renamed.

  • A link to „twice“ is decorated by # ahead and reported by −1× #twice item.

Strange Anchors edit

Identifiers to be avoided receive a red anchor symbol. The hover bubble shows text in red colour on yellow background.

  • A hash # inside is confusing.
  • A percent % inside could be mixed up with URL encoding.
  • A fragment should best start with letter, but at least not with digits like 42.
  • Two question marks ?? in fragment might indicate a detected error situation.

Structural error summary edit

At page top a summary should list structural errors – for the current page:

  • 2× #twice
  • 1× #
  • −1× #nirvana
  • −1× #twice